|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Hi
Can anyone point me in the direction of some example code for Firebird 1.5/2.0 as I am getting a "Deadlock" error when using the SQL Update command from inside my app, when run multi-user. I need to run a transaction. I also have triggers with update code in the trigger. This also deadlocks. Is there a HowTo to get this working? I am using Delphi 7. Thanks Chris |
|
#2
|
||||
|
||||
|
You'd better Google (for the tutorial only) or show us your logic and a meaningful example if you are looking for advice
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
|
#3
|
|||
|
|||
|
I am using Delphi 7, Firebird 2 and BDE
If I run the following code on 2 client PCs at the same time I get a "Deadlock" error. for count := 1 to 10 do begin quTemp.sql.clear; quTemp.sql.add( 'update PRODUCT set' ); quTemp.sql.add( 'PRICE=:Price' ); quTemp.sql.add( 'where PRODUCTCODE=:ProductCode' ); quTemp.parambyname('Price').AsFloat := 10; quTemp.parambyname('ProductCode').AsInteger := 1; quTemp.ExecSQL; end; I have only placed the update in a loop to insure a conflict everytime I run the test program. However I created this program because my main application was also having the same problem intermittently when posting only once. I have tried to find a way to set the Transaction to "wait" for any other transactions to complete before attempting to start but nothing seems to have any effect. I have also tried using Interbase Express components to go around the BDE but this also made no difference. Any help you can give me would be very gratefully received. Chris |
|
#4
|
||||
|
||||
|
That's normal behaviour, you should simply catch the error and tell the user that the record is already in use by someone else.
Or you can alter the transaction isolation level (see here ) but I's unsafe |
|
#5
|
|||
|
|||
|
hmm sure i have an idea if you use the ibtable etc then you can create a code then you can catch it with ibevent
as an exam when a user edit on the record then you can check it and showmessage('record cant to be edit mode etc'); |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Firebird 1.5 / 2.0 Deadlocks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|