Subject Re: [IBO] How to get the record id that was just stored with a query
Author Antti Kurenniemi
>>BeforePost for that query doesn't fire, what could be the reason for that?
>>Is it maybe because my Transaction component is set to autocommit, and so
>>in
>>my code I only call Query.Execute? The record is inserted and everything
>>otherwise seems to work ok.
>
> What statement class are you using?

I'm using IB_Query. The data is stored when I call Execute in the code, but
the IB_Query component's BeforePost does not execute at any point. Strange.
I'll make a dummy app and play with this a little, to see if it's something
else in my project that's causing this.


> Use Autocommit only with great care. Be careful that you do not isolate
> your insert operation from other data that are going to use that stored
> value. If that operation is a piece of a broader task, then you should
> not
> be using Autocommit for the separate pieces of the task. The whole
> purpose
> of a transaction is to "throw a rope around" multiple operations, to keep
> the state of data consistent for each and every operation until the task
> is
> either completed (by committing) or backed out (by rolling back).

Yay, this is exactly where I'm going next - at this point I'm just taking
some shortcuts while learning, so autocommit is on to make things slightly
simpler.


Antti Kurenniemi