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!

how to handle a branch rollback

40467Nov 6 2001
When using distributed transactions there is a need to rollback a
branch of the transaction but commit the rest.
When I try this using the oracle drive I get:
ORA-02051: another session in same transaction failed

which happens because the entire transaction did not commit but
it should not need to only the non rolled back ones do.

here i my logic:

getxaconnection
getxaresource
create an xid
xaresource.start(xid)

// roll this back
getxaconnection
getxaresource
create an xid
xaresource.start(xid)
xaressource.end(xid)
xaresource.rollback(xid)

xaresource.end(xid)
xaresource.commit(xid)

the exception is thrown on the second earesource.end

ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2001
Added on Nov 6 2001
0 comments
481 views