Subject Re: [Firebird-Java] Re: autocommit mode
Author Ann W. Harrison
At 03:09 PM 6/9/2003 +0000, Roman Rokytskyy wrote:

>All changes made by a trigger are discarded by the server internally
>in case of error. However, I do not know what happens if multiple
>triggers are fired for one statement. In theory _all_ changes should
>be discarded.

Yes, they are.

> > So the general question could be: what happens after a SQL error
> > occurs and autocommit mode is switched on?
>
>In general it is quite interesting question... Transaction should be
>rolled back. Driver is relatively simple here. It tries to commit
>transaction, if commit fails, it performes rollback (probably we can
>simply rollback tx in auto-commit case). So, it is the responsibility
>of the database server to _not allow_ transaction to be committed. I
>am almost 100% sure that in scenario described above transaction will
>be rolled back.

Yes, all the changes of a single statement that encountered an error
from at trigger will be undone by the engine. At that point, you may
commit or rollback - it doesn't matter.


Regards,

Ann
www.ibphoenix.com
We have answers.