Missing Transaction.inTransaction

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Hirschi
Posts: 3
Joined: Wed 16 Sep 2009 05:39

Missing Transaction.inTransaction

Post by Hirschi » Wed 16 Sep 2009 05:48

Hello guys,
since I'm a rookie on IBDAC, this should be an easy task for you. ;)

I've replaced the IBTransaction component with the brand new 3.10 IBCTransaction component. Only bad thing is, that I used the property IBTransaction.inTransaction in an IF statement in order to commit the transaction if it's active.

What's your suggestion to reach the same goal with IBCTransaction?

Greetz
Hirschi

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 16 Sep 2009 07:45

Use the Active property.

Hirschi
Posts: 3
Joined: Wed 16 Sep 2009 05:39

Post by Hirschi » Wed 16 Sep 2009 08:03

Thanks! I'm gonna try it. :)

Hirschi
Posts: 3
Joined: Wed 16 Sep 2009 05:39

Post by Hirschi » Fri 18 Sep 2009 13:31

Okay, it worked. But it seems, that after I do a Transaction.Commit, the Active property is set to false. Am I right?
Is there a way of preventing to auto close the transaction, after commit?

Now I'm doing it like this:

If Transaction.Active Then
Transaction.Commit;
Transaction.Active := True;

If I don't set it on 'true' again, I can't do any Commits.

Greetz
Hirschi

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 21 Sep 2009 08:04

You can call the CommitRetaining method instead of Commit. CommitRetaining does not close the transaction.

Post Reply