Board index » delphi » Synchronizing data in the IB db for multi-user app

Synchronizing data in the IB db for multi-user app

Hi,

I have 2 concurrent users trying to modify a field in a table. How can one
user
see the change made by the other in order to avoid accidential overwriting?
Is it done in the database or in the
application?  Thanks a lot for suggestions.

Bao

 

Re:Synchronizing data in the IB db for multi-user app


The second user to post his/her changes will get an error message indicating
that the record has been changed by another user. To see the changes re-run
your query to reread the record.

--
Bill

Re:Synchronizing data in the IB db for multi-user app


Bill,

How come the second user get an error message?  Where does the error message
come from, from IB or TDatabase? And where would the error message handler
be? Do you specify an isolation level at all?

Thanks for your suggestions.

P.S.
I may restate the problem:
I have 2 concurrent users looking at the same record of a table, then one
user makes changes on the record.  How can I make the other user aware of
the changes?

"Bill Todd (TeamB)" <b...@nospamdbginc.com> wrote in message
news:3a707ced$1_2@dnews...

Quote
> The second user to post his/her changes will get an error message
indicating
> that the record has been changed by another user. To see the changes
re-run
> your query to reread the record.

> --
> Bill

Re:Synchronizing data in the IB db for multi-user app


It appears from your message that you are connecting to Interbase using the
BDE and the Interbase SQL Links driver. If the second user tries to post
his/her change after the first user has posted a change but not committed
the transaction the second user will be notified that the record has locked.
If the first user has committed the BDE will detect that the record has been
changed by trying to reread it using the original values immediately before
it posts. If one of the field values has changed the record will not be
found and the second user will be notified that the record has been changed
by another user. Use the OnPostError event to trap these errors. The BDE
defaults to read committed transaction isolation. To get snapshot isolation
(which some people call repeatable read although it does not match the SQL
92 definition of repeatable read) set the driver flags property of the
Interbase SQL Link driver to 512 in the BDE Administrator.

--
Bill

Other Threads