Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 6 of 6 total |
Transactions |
Thu, Nov 13 2008 10:23 AM | Permanent Link |
Leslie | Tim,
1. Is there a way to query from within a stored procedure/trigger/script if it is executed int the context of a transaction? 2. Are simple update/insert/delete commands executed in the context of a transaction if none is tarted by the application? I would like to understand what to expect when the updated table has triggers updating other tables, which has triggers updating other tables .... Are the triggers, and triggers of the other updated tables executed in a atomic fashion? Regards, Leslie |
Thu, Nov 13 2008 11:44 AM | Permanent Link |
Leslie | <<1. Is there a way to query from within a stored procedure/trigger/script if it is
executed int the context of a transaction?>> I have on solution. Is this Efficient? BEGIN Declare WasInTransaction bool; Begin START TRANSACTION Exception Set WasInTransaction = True; end; ... if not WasInTransaction then Commit; end if; ... EXCEPTION if not WasInTransaction then RollBack;; end if; END; Regards, Leslie |
Thu, Nov 13 2008 11:45 AM | Permanent Link |
Leslie | I have on solution = I have one solution
|
Thu, Nov 13 2008 3:27 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Leslie,
<< 1. Is there a way to query from within a stored procedure/trigger/script if it is executed int the context of a transaction? >> Not at this time, no. It is assumed that triggers and stored procedures shouldn't care either way. << 2. Are simple update/insert/delete commands executed in the context of a transaction if none is tarted by the application? >> Sort of. They are batched up, but occasionally are flushed to disk for performance purposes. << I would like to understand what to expect when the updated table has triggers updating other tables, which has triggers updating other tables ... Are the triggers, and triggers of the other updated tables executed in a atomic fashion? >> Triggers are only executed in an atomic fashion if they are executed under an active transaction. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Nov 13 2008 3:30 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Leslie,
<< I have on solution. Is this Efficient? >> Efficient enough for your purposes. You'll want to change this line, however: Declare WasInTransaction bool; to this: Declare WasInTransaction bool DEFAULT False; -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Nov 13 2008 3:57 PM | Permanent Link |
Leslie | Thank you Tim!
Regards, Leslie |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |