Nested Transactions
Posted in 1998
I'm currently involved with a project that is using Informix 7.3 DBMS. Being new to Informix, I have a couple of questions that I can't find the answer to in any documentation that I've gone through. I have extensive knowledge of other database engines and would like to know how to perform certain actions in Informix, that I would typically perform using other engines. Holding to the black box approach to programming, a stored procedure (SP) should not assume any knowledge of its caller's transactional state. To this end, how would you transactionalize a SP so that it would work properly when called directly or when it is called by another SP that has already started a transaction? With other engines I could interrogate the session environment and determine if a transaction has already been started. If a transaction has already been started, I would create a save point and then commit or rollback to the save point. If a transaction hasn't been started, I would begin a transaction and commit or rollback accordingly. This way the SP always works with the proper transactionalization. How can a SP tell if it is being called by another? Is this possible? With other engines I could interrogate the session environment to determine what the nesting level currently is. If the nesting level was greater than 1 it meant that the SP was being called by another SP. Is there any concept of this with Informix? Thanks for your help in advanced. Bruce Richardson Onyx Computers bruce.richardson@onyxcomputers.com