Do I always need boilerplate code to prevent nested transactions?
1
vote
1
answer
204
views
Because I never know if my procedure might be called from other procedures that have an opened transaction, should I always check for existing transactions before opening a new one?
It seems like a bit of boilerplate code that I need to repeat everywhere and it will make for worse readability.
I'm trying to future proof against this error:
> Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0.
Example of boilerplate code Exception handling and nested transactions
Asked by Zikato
(5724 rep)
Mar 6, 2020, 09:48 AM
Last activity: Jun 20, 2025, 02:05 AM
Last activity: Jun 20, 2025, 02:05 AM