Posted by ImOk on 10/26/77 11:48
Method 1) The easiest way would be to have on each table a last
modified timestamp and user.
Before writing, check the timestamp and user (see Method 2) and see if
it was changed since you read it last. If different, then pop up a
message for appropriate action (force overwrite or reload).
Caveat: If other apps modfying the database and dont honor timestamp
you could have a problem. Of course you can have a trigger in the
database to force a time stamp write on each update so no one forgets.
Method 2) Test the columns like suggested above and display message.
BUT you still need Transaction based updates in case of more than one
table.
If you have to apply the changes to multiple tables (relational stuff),
then you do need the begin transaction/commit/rollback in case any
tables have changed.
Begin Transaction
Select * from A with lock
Select * from B with lock
If any columns (or timestamp/user) of above cursors changed
Rollback/Error
else
Update
Commit
endif
Navigation:
[Reply to this message]
|