Re: transactions lasting over two processes
Posted in 1995
> kieni@dfki.uni-kl.de (Thomas Kieninger) writes: > Hello out there, > > I have a quite silly question, but I would really like > you to give me serious comments if possible: > > Is it possible to start a transaction from within one > application (process) and stop (rollback or commit) it > from within another application? Not a silly question at all. What you are asking about is a feature commonly called "2-phase commit". A 2-phase commit can be used to coordinate transactions: - across processes (your question) - across machines - across heterogeneous DBMSs > To my opinion this requires a kind of unique transaction-ID > that has to be given. And I doubt that this is provided. > > I think, the only way to solve my problem, is to spawn a > separate process that lives for the time of the transaction > and that acts as a server to the other applications that start > and stop transactions. > > Has anybody any experience? > Any hints, warnings, guidelines, security considerations? > Do other DB-management systems than Informix products allow this? > Can you think of a sample application where this mechanism could > be of use? Informix, Oracle, DB2/6000, Ingres and Sybase all provide some form of 2-phase commit. It usually comes in two flavors: 1. Proprietary invocation supported by the DBMS and not applicable to heterogeneous DBMS environment. 2. Standard X/OPEN "XA" 2-phase commit. Works the same way with all DBMSs and heterogeous environments. Often the XA mode is coordinated by a TP Monitor such as Tuxedo or Encina. Your program issues a "tx_begin" and "tx_commit" to the TPM, which then tells the DBMS(s) what to do. In our product we use the XA 2-phase commit. I know Informix also has the proprietary form but we do not use it and thus I can't pass on any specific hints. -- Gary > Please send me e-mail if you have any suggestions. > > Thanks in advance > Thomas > > -- > -------------------------------------------------------- > Thomas Kieninger > Deutsches Forschungszentrum fuer Kuenstliche Intelligenz > > DFKI-GmbH Tel: +49-631-205-3485 > Postfach 2080 Fax: +49-631-205-3210 > 67608 Kaiserslautern E-Mail: kieni@dfki.uni-kl.de > > WWW: http://www.dfki.uni-kl.de/~kieni/cv.html > > > >>>> --------------------------------------------------------------------------- Gary Long glong@magna.com Vice President, Product Development Magna Software Corporation Phone: 703/222-3500 12450 Fair Lakes Circle Fax: 703/222-8433 Fairfax, Virginia 22033 Technical data on "MAGNA X" CS/TP Application Generator info@magna.com