Board index » delphi » how to update concurrent transaction ?

how to update concurrent transaction ?

hi guys,

I have a system called 'Library Transaction System'. And I have a design a
module/form that deal with borrowing transaction. It work fine in a stand
alone pc. But the problem arise when several user log in the form
simultaneously.

When user A log in the PC1, he access the "Book Borrowing' module and try to
borrow a book with book id = 1. At the same time, user B also log in using
the PC2 n call the 'Book Borrowing module' also, and try to borrow a book
and try to borrow a book with book id = 1 also. When the book succesfully
been borrowed by A, the status of the book will changed to 'Not
available'!(suppose to be) ...

But at the same time, user B also 'allowed' by the system to borrow the book
out coz the status of that book still in 'available' mode. so, may i know
how to overcome it ?

i set the transaction to read-committed but still can not ... !!

 

Re:how to update concurrent transaction ?


Quote
lee wrote:

> But at the same time, user B also 'allowed' by the system to borrow the book
> out coz the status of that book still in 'available' mode. so, may i know
> how to overcome it ?

        When user B attempts to change the status of the book, user B will get
a deadlock error.  At that point in time, it is appropriate to re-query
the status of the book, and you'll see that it has been changed to "not
available."

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Other Threads