Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JDBC, Oracle thin driver and transactions

9 views
Skip to first unread message

Aoife Kavanagh

unread,
Sep 5, 2000, 2:01:00 AM9/5/00
to
Hi,

I sent a mail on Friday regarding problems that I'm encountering
whenever I attempt to start a transaction using JDBC2 and the
Oracle thin driver. I'm no nearer solving my problem, just managing
to replace one exception with another. I have got rid of the
PLS-00201: identifer 'JAVA_XA.XA_START' must be declared exception.
However, that has just been replaced with

java.sql.SQLException: ORA-29532: Java call terminated by uncaught
Java exception: java.lang.NullPointerException
ORA-06512: at "SYSTEM.JAVA_XA", line 0
ORA-06512: at line 1

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
at
oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738)
....

instead. The code sample that throws the exception is
// Retrieve Oracle data source from JNDI
OracleXADataSource oxds = (OracleXADataSource)utility.getDataSource();
pc = oxds.getXAConnection();
conn = oxds.getConnection();
oxar1 = pc.getXAResource();
xid1 = createXid(1);

// Everything works fine up to this point
// This line of code then causes everything to give up
oxar1.start (xid1, XAResource.TMNOFLAGS);

This is example code taken from Oracle's programming guides!
I don't think it's my code here that's the problem, I'm thinking
that it's the installation, but I have no idea what. I've no knowledge
of Oracle, and our DBA doesn't know what the problem is either.

ANY help whatsoever would be appreciated as this is driving me nuts!

Thanks,
Aoife

Avi Abrami

unread,
Sep 6, 2000, 3:42:02 AM9/6/00
to
Aoife Kavanagh wrote:

This may be stating the obvious, but a quick look at your code
snippet suggests that the reference 'oxar1' is null - which means
that the method call "pc.getXAResource()" is returning null.
Perhaps you could check for this (with a simple 'if' statement
like: if (oxar1 == null)). Does the documentation mention
anything about the possibility that the method "getXAResource()"
may return null?

HTH,
Avi.


Aoife Kavanagh

unread,
Sep 6, 2000, 6:13:19 PM9/6/00
to
Hi Avi,

Thanks for the suggestion, but no go. My XA resource that I have
obtained is valid.

Ideas from anybody else?

Aoife

eug...@my-deja.com

unread,
Sep 25, 2000, 3:00:00 AM9/25/00
to
I think you need to check two thingd:
1. JAVA.XA package inside database - try to use
it from some PL/SQL routine - if you can do
this - so your problem in permissions , else DBA
need to reinstall this package
2. createXid(1) - is not very good way to build
xid -
I don't think this is a your problem , but you
need rewrite createXid function - to make Xid
really unique
I hope its help
Eugene


Sent via Deja.com http://www.deja.com/
Before you buy.

0 new messages