I guess if the trigger contains database operations, they would be
rolled-back as well.
The question is, if the trigger externalizes some internal state, how can a
rollback revoke that?
A stupid example would be, a trigger sends out an email saying "a inserted",
but this transaction actually fails. The email recipient then is in a wrong
state...

Thanks.
-Simon


Igor Tandetnik wrote:
> 
> Simon Chen <[email protected]> wrote:
>> A simple question... Say I have a bunch of db insert/updates
>> performed as a transaction. If the table has a "AFTER INSERT"
>> trigger, is it fired: 1) right after the insert statement?
>> 2) right before transaction commit?
>> 3) after commit?
> 
> Running trigger is an integral part of executing a statement. I guess #1 
> is closest.
> 
>> And what if the transaction fails if 1) or 2) is the case?
> 
> Then it's rolled back. This is unrelated to whether there are any 
> triggers.
> 
> Igor Tandetnik 
> 
> 
> 
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/trigger-with-transaction-tp22959986p22963996.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to