Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> How to get native ora error for xa XAER_RMERR?
Hi all, I need some help trying to get back error codes.
I'm using the oracle xa interface for 2 phase commit, and I'm using it in C, not with jdbc.
What I'm looking for is the C equivalent for the jdbc method getOracleError() from the class oracle.jdbc.xa.OracleXAException
Using C and oci, I use xaoEnv and xaoSvcCtx to get the
needed handles, but can't find a way to either get the
corresponding error handle or some function to obtain the
native error code when I get an XAER_RMERR. For example,
I'm tracing the xa client and see this:
...
172952.39538.1:
xaoprepare: xid=0x3e8-010203-01, rmid=1, flags=0x0
172952.39538.1:
OCITransPrepare: Attempting
172952.39538.1:
ORA-02091: transaction rolled back
ORA-02290: check constraint
(J15USER7.SYS_C00570619) violated
172952.39538.1:
xaoprepare: rtn -3
...
This last -3 is what xa_prepare returns and is XAER_RMERR. What I'm trying to get at is the ora-02091 and ora-02290 that appear in the trace file and using jdbc I can get with the getOracleError function, but using C and OCI functions.
In other words, I want to do better than a generic XAER_RMERR code.
Any help will be appreciated.
Michael
--- UC Irvine Database Research Group 444 Computer Science, On loan to the University of U. of California at Irvine, California, Irvine (Researcher) Irvine, CA, 92697-3425Received on Wed Nov 03 2004 - 19:34:07 CST