Page 1 of 1

Missing Transaction.inTransaction

Posted: Wed 16 Sep 2009 05:48
by Hirschi
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

Posted: Wed 16 Sep 2009 07:45
by Plash
Use the Active property.

Posted: Wed 16 Sep 2009 08:03
by Hirschi
Thanks! I'm gonna try it. :)

Posted: Fri 18 Sep 2009 13:31
by Hirschi
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

Posted: Mon 21 Sep 2009 08:04
by Plash
You can call the CommitRetaining method instead of Commit. CommitRetaining does not close the transaction.