Re: transactions lasting over two processes
Posted in 1995
}From: timward@crl.com (Timothy E. Ward) }Date: 23 Aug 1995 13:49:06 -0700 }X-Informix-List-Id: <news.16481> } }Thomas; } }I believe that, by default, Informix Transactions will "span" spawned }processes. So, if Process A starts a transaction and then spawns Process }B, both A and B are running under the same Transaction. Thus, if Process }B performs a ROLLBACK, both A's and B's updates are rolled back. }Likewise for COMMITS. However, if Process A and Process B are both active concurrently, all hell will break loose as they both try to communicate with the engine (server) simultaneously -- sooner or later (probably sooner), process A will read data intended for process B or vice versa. And the engine will be confused as it gets commands out of sequence. It is not a good idea to try it; if you do try it, ensure that when process A forks process B, process A stays out of the way of process B. }If you wanted Process A's and Process B's Transactions to be independent, }you would issue a call to sqldetach() from with Process B to disconnect }Process B from the parent's (Process A's) transaction (database connection). }You would then explicitly start a new transaction from Process B. }Process A's DB transaction would still be intact, but would be }independent from process B's. } } Thomas Kieninger (kieni@dfki.uni-kl.de) wrote: }: Is it possible to start a transaction from within one }: application (process) and stop (rollback or commit) it }: from within another application? Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> ,.