Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> 2PC using XAResource interface in J2EE and C++

2PC using XAResource interface in J2EE and C++

From: James Liu <jianliu15_at_hotmail.com>
Date: 6 Sep 2002 18:10:45 -0700
Message-ID: <5acbfc67.0209061710.40e0ce38@posting.google.com>

I have a C++ program (non-CORBA) that manages and uses a pool of connections to multiple Oracle databases. I want the work done in the C++ program to be part of a global transaction started in a J2EE server, and let JTS to coordinate the commit/rollback.

There are many uncertainties on how that could be done. Some of the questions are:

  1. What's the relationship between a XAResource and the connections I am going to use in my C++ program? I did not find any mentioning about "registering a connection" in Oracle's documentation on XA. Is it because that the thread calling xa_start(XID) is the same one that uses the connection, so the resource automatically associates the work done by this thread to the transaction?
  2. The data section of xid_t is comprised of two parts according to XA Specification - gtrid and bqual. How is bqual used? If I have two processes:

Process 1:
xa_start(XID1)
//do work

xa_end(XID1)

Process 2:
xa_start(XID2)
//do work

xa_end(XID2)

XID1 and XID2 differ only in bqual. When xa_commit(XID1) is called, would the work in both processes be committed, or I would have to call xa_commit(XID2) also?

Appreciate any enlightment!

James Received on Fri Sep 06 2002 - 20:10:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US