Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Using OCI (v7.x) how to make a two phase commit work ?
A copy of this was sent to "Steven Belbin" <steven.belbin_at_consyst-sql.com>
(if that email address didn't require changing)
On Mon, 4 Jan 1999 15:08:01 -0500, you wrote:
>Hi,
>
> I will directly get to the point, using OCI (version 7.x) how can I
>issue a prepare to commit statement, followed either by a confirmation or
>cancelation of the previously prepared transaction.
>
> The context is the following; I wrote a program that applies the two
>phase commit model on a relational database and other data sources. The
>other data sources are not necessarily a relational database (it could be a
>COM / CORBA transaction, third party product, etc...). These data sources
>are just required to provide the two phase commit model.
>
> In short, I wrote a lite model of a transaction manager (like TUXEDO,
>ENCICA) specifically for our software.
>
> With OCI version 8, Oracle has publically provided the the OCI C
>functions to manage a database transaction. Thus allowing us to start a
>database transaction, issue a prepare to commit, commit, rollback and
>stopping of the database transaction (yeah, no problem for OCI version 8).
>
> How can I manage a database transaction with an Oracle 7 database
>(especially the prepare to commit statement, commit and rollback ) ?
>
> Under OCI version 7.x, how could this be achieved ?
>
>
>P.S. :
>
> I know it is possible, since several X-OPEN compliant transaction
>managers have successfully implemented it for Oracle 7 databases. However,
>most of our clients do not use one of these X-OPEN compliant transaction
>managers. Therefore X-OPEN solutions are not applicable in my case.
But the problem here is that they use the XA interface to Oracle and you have just said "No XA, No X-Open". We have an XA interface to Oracle in v7. We use it with Tuxedo and others.
Short of that, in v7, you could make oracle the 'commit' point -- that is, ask the other N-1 data sources to prepare to commit. If they all vote yes, then issue the commit in Oracle v7. If it succeeds -- the 'vote' from Oracle was to commit (and it already has). If it fails -- the 'vote' from Oracle was to rollback (and it already did).
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Jan 04 1999 - 15:34:47 CST