Transaction.OnError not firing when running Script

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Transaction.OnError not firing when running Script

Post by upscene » Fri 29 Oct 2010 08:50

Hi,

I have a TIBCScript component with a script in it, including a COMMIT statement.

I have an event handler for the transaction component OnError, the COMMIT fails (transaction stays active), but the OnError event on the transaction component is never firing.

When I use a TIBCQuery on the -same- transaction component, and do a COMMIT, the event fires.

When I manually call the Commit method on the transaction component, I get an exception.

What's going on here?

With regards,

Martijn Tonies
Upscene Productions

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 01 Nov 2010 14:40

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next IBDAC build.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Mon 01 Nov 2010 14:43

Dimon wrote:Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next IBDAC build.
Good, any idea when we can expect the new release?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 01 Nov 2010 14:52

The next IBDAC build will be released by the end of this week.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Fri 19 Nov 2010 16:05

Dimon wrote:The next IBDAC build will be released by the end of this week.
Hello Dimon,

I downloaded the latest, but this error doesn't seem to be fixed.

The "COMMIT" in the Script fires the Transaction.OnCommit event, but not the OnError event (the commit fails with "object in use" error), the exception reaches TApplicationEvents.OnException, thus not handled by the Transaction component.

Can you urgently re-check this, I was waiting for this fix!!

With regards,

Martijn Tonies
Upscene Productions

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Tue 23 Nov 2010 11:55

upscene wrote:
Dimon wrote:The next IBDAC build will be released by the end of this week.
Hello Dimon,

I downloaded the latest, but this error doesn't seem to be fixed.

The "COMMIT" in the Script fires the Transaction.OnCommit event, but not the OnError event (the commit fails with "object in use" error), the exception reaches TApplicationEvents.OnException, thus not handled by the Transaction component.

Can you urgently re-check this, I was waiting for this fix!!

With regards,

Martijn Tonies
Upscene Productions


Any news?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 24 Nov 2010 08:44

The TIBCTransaction.OnError event arises only when two or more connections are associated with the transaction. When only one connection is assigned to the transaction, then the OnError event of the TIBCConnection class arises.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Wed 24 Nov 2010 08:48

Please change that! How can I know if a "commit" has failed in TIBCConnection.OnError? It's much easier to check transaction errors in TIBCTransaction.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Wed 24 Nov 2010 14:56

upscene wrote:Please change that! How can I know if a "commit" has failed in TIBCConnection.OnError? It's much easier to check transaction errors in TIBCTransaction.
OK, never mind, I fixed it another way.

But please do change the Documentation on this as it says:
Occurs when processing errors that are raised during executing transaction and savepoint control statements such as COMMIT, ROLLBACK, SAVEPOINT, RELEASE SAVEPOINT and others.
Class
TIBCTransaction
Syntax
property OnError: TIBCTransactionErrorEvent;
Remarks
Write the OnError event handler to process errors that occur during executing transaction and savepoint control statements such as COMMIT, ROLLBACK, SAVEPOINT, RELEASE SAVEPOINT and others. Check the E parameter to get an error code.
Note: You should explicitly add IBCError unit to 'uses' list to use OnError event handler

With regards,

Martijn Tonies
Upscene Productions

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 25 Nov 2010 08:57

Thank you for your inquiry. We will correct this information in the help in the next IBDAC build.

Post Reply