Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

what to do with STATUS_ROLLEDBACK

843854Aug 1 2002 — edited Aug 21 2002
I have a msg-driven bean doing db insertions using bean-managed txns. I start a JTA txn, insert a batch, send the valid records to a JMS queue, and then end the txn. To end the txn, I check the status and act accordingly. It's clear what to do when txn status is STATUS_ACTIVE (commit), STATUS_MARKED_ROLLBACK (rollback), or STATUS_NO_TRANSACTION (do nothing), but it's less clear what to do in other cases.

The case I'm getting right now is STATUS_ROLLEDBACK. From the javax.transaction.Status docs:
A transaction is associated with the target object and the outcome has been determined as rollback. It is likely that heuristics exist, otherwise the transaction would have been destroyed and NoTransaction returned.

First off it seems weird that the txn was rolled back without me ever recieving an exception or calling rollback, or even setRollbackOnly. But nevermind that--I'll assume that the db decided in it's wisdom that a rollback was required, did it, and returned normally.

Does this mean I should try another rollback, or would that fail since the thing has already been rolled back?

My other thought was that I need to check and clear the warnings on the db cnxn. These are the only "heuristics" I can think of--I can't find anything about heuristics in the JTA package itself.

I've searched newsgroups and the web for a couple of hours now, but I've been unable to find any discussion of these issues. Any pointers would be most welcome :)

Much obliged for the help,
alex

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2002
Added on Aug 1 2002
1 comment
382 views