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

OracleConnection rollback failed! What to do?

160 views
Skip to first unread message

theRat

unread,
Jun 10, 2005, 12:57:12 PM6/10/05
to
All,

I am running Oracle 8i and have run into a problem. While attempting
to update a row in the database, an exception was thrown (see below).
I caught the exception and attempted to perform a rollback on the
connection (the connection was of type OracleConnection).
Unfortunately, when attempting to perform the rollback on the
exception, *another* exception was thrown - I was not able to perform
the rollback. I need to know what I should do in this situation.

Unfortunately, I do NOT have more information about the exception that
was thrown *during* the rollback - I'm adding debug code there now but
I've been unable to reproduce the problem anyway. So this is a more
GENERAL question. What is the philosophy on dealing with a failed
rollback? The connection is holding on to some locks which is bringing
my application to a standstill - i have to free those locks. I
obviously can't perform a commit.

If it helps, here is the stack for the FIRST exception that was thrown
- the one that forced me to ATTEMPT a rollback - this is NOT the stack
from the actual rollback:

java.lang.NullPointerException
at
oracle.jdbc.driver.T4CNamedTypeAccessor.unmarshalOneRow(T4CNamedTypeAccessor.java:135)
at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:785)
at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:702)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:527)
at
oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:180)
at
oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:783)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1027)
at
oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2885)
at
oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:2976)
at
oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4103)

I've never seen an exception like this before and I'm guessing it's
very related to why the rollback itself also failed (threw an
exception).

Any light anyone can shed on this problem?

Thanks,

-john

joe.we...@gmail.com

unread,
Jun 10, 2005, 1:24:48 PM6/10/05
to
Hi. The NullPointerException seems to be an ugly
simple bug in the Oracle thin driver you're using,
but it might have been triggered by a lower-level
connectivity problem that also caused your rollback
to fail.
I would update your thin driver to the latest 10G one,
and in the case of a failed rollback, it hinges on whether
this is a simple local tx or an XA tx. Xa has a recovery
protocol that tries to determine the status of the tx
after a reconnect is made. A non-XA tx leaves it up to
you to reconnect (I'm guessing the connection is dead),
and see if what you tried to do and then rollback succeeded
or not. Most DBMSes will roll back any abandoned transactional
content on a connection that goes away without explicitly
committing, but Oracle is different, and *will* commit sometimes.
Joe Weinstein at BEA

0 new messages