To get a deadlock you need two transactions. User A starts transaction, updates table A, User B starts another transaction and edits table B. User A now updates table B. User A is forced to wait for B to commit or rollback before A can commit. User B updates Table A, and similarly has to wait for A. Deadlock.

Terry


Craig Goodall wrote:


Hi Moisis,

Not being an expert here, but your transaction sounds fine and the nowait should cause an exception immediately, at which time you can RollBack. To cause a deadlock, I would try something like

1. StartTransaction
2. edit a row
3. don't Commit

with (say) one button on a form, and then do the same from another button on the form. Not sure, but I think this (or a slight variation) may cause an error for you.

HTH,
Craig.


Moisis Lspez wrote:

ok i give up...
i have an app w/ 3 users so far.. (D6 & IB OS)
question is either.. how do you guys handle a deadlock error?, or.. how can i generate one? so i know how to deal wih it..
so far its not much of a trouble yet cause it happens very seldom, but i want to know

i have several transactions,all defined as "read_committed, rec_version, nowait"

thanks
moises

---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

.

---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/


---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to