Subject Re: [IBO] OnAfterCommit event / OnAfterPost event
Author Helen Borrie
At 10:08 PM 30/04/2007, you wrote:
>In my application I'll have to make some delphi operations and send an
>additional SQL to the server, after the table row is posted.
>I've tried to do these things in the IB_query.OnAfterPost Event, but
>then I'll
>get a locking error (deadlock. update conflicts with concurrent update).
>Okay, maybe the transaction and locking is still active in the OnAfterPost
>event of the query, so I moved it into the associated
>IB_Transaction.OnAfterCommit.
>But this event is not firing at all (auto-commit is set to True in
>the IB_query).
>
>What is the correct event to use, when additional table row updates should
>happen immediately after a post?

It depends what you want to do. AfterPost occurs while the
transaction is still uncommitted. It is a dataset method.

AfterCommit is a notification event that occurs after Commit was
called from the client. It has no context at dataset level if the
transaction is in Autocommit mode, since this causes the transaction
to commit as soon as any dataset's Post succeeds.

Could you explain what this extra statement does? With your
transaction in Autocommit mode, if it was applicable to database
state *before* the dataset Post occurred, it will be out of date by
the time the dataset's work has been Posted and the transaction committed.

On face value, it seems like something you should be doing on the
database side, in an After trigger.

Helen