This is a very good article. I have 2 comments:
- Why do you need the while loop and tInitLevel at all? I think that code that uses transactions must balance each
tstartwith either atcommitortrollback 1. So the difference between$tlevelandtInitTLevelshould always be 1. And no code should ever usetrollbackwithout the 1. Your code should roll back your transaction and no one else's. - When tstart/tcommit was first added to the language, best practice was placing the
tstartandtcommitat the beginning of the code that is about to change globals, keeping it isolated as much as possible from anything else. I’d suggest moving the tstarts in your examples lower in the code block, right before the “do the important stuff” code.
- Log in to post comments