BDE to IBDAC - Transactions

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
rhettp
Posts: 25
Joined: Tue 15 Aug 2006 01:25

BDE to IBDAC - Transactions

Post by rhettp » Sun 10 Sep 2006 05:27

Is it wrong to think that coming from the BDE where I used no explicit Interbase Transactions - that I can just be sure to set AutoCommit on all my TIBCQuery's and be ok with transactions?

I'm seeing some weird locks occuring when 2 programs are running accessing the same DB. When the 2nd app does an Update and then the program closes, the 1st app has problems seeing the committed transaction. If the 1st program tries to update that same the record, I get: Deadlock, update conflicts with concurrent update.

Also, if this makes any difference, I am using the "Classic Firebird" mode because I have 2 processors and SuperServer mode didn't run well. (Is there any known problems with Classic mode?

Thanks,

Rhett

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Mon 11 Sep 2006 13:50

This problems are caused by transaction isolation level, in InterBase and IBDAC by default it is Snapshot. The snapshot transaction can't edit records that were edited and even committed after transaction started. The solution is to use transaction with "Read Committed" isolation level.
If you are using Delphi6 or higher then you can do this by accessing IBCConnection.DefaultTransaction.Params property in Object Inspector and setting "Read Committed" Transaction Kind.
If you use Delphi 5 then you should use additional IBCTransaction component, set up it with "Read Committed" isolation level and link to IBCConnection.DefaultTransaction

rhettp
Posts: 25
Joined: Tue 15 Aug 2006 01:25

Post by rhettp » Mon 11 Sep 2006 15:03

That worked great! You guys have awesome support.

Thanks,

Rhett

Post Reply