About Question enthuware.oce-ejbd.v6.2.610 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
goetz

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Post by goetz »

In option 2, instead of
call ut.getStatus() != Status.STATUS_ROLLEDBACK at INSERT CODE HERE.
shouldn't it be:
call ut.getStatus() != Status.STATUS_MARKED_ROLLBACK at INSERT CODE HERE.
Because anotherMethod() merely marked the txn for rollback instead of actually rolling back the txn...

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Post by admin »

I think STATUS_ROLLEDBACK is fine as well because the API for STATUS_ROLLEDBACK says,
A transaction is associated with the target object and the outcome has been determined to be rollback. It is likely that heuristics exist; otherwise, the transaction would have been destroyed and NoTransaction returned.

Alan

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Post by Alan »

First option is right:

if (!ut.getRollbackOnly()) {
// executes only if anotherMethod has NOT set the transaction for a rollback
}

Am I missing something?

Alan

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Post by Alan »

UT does not have such method :oops:

aminoss007

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Post by aminoss007 »

getRollbackOnly() method is reserved for container managed transaction, ejbContext.getRollBackOnly().

Nuno Agostinho

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Post by Nuno Agostinho »

Just tried it with Glassfish and the status that it gets in this situation is Status.STATUS_MARKED_ROLLBACK.
And if the client only marks as rollback, then it can never be Status.STATUS_ROLLEDBACK at this point because no commit or rollback was attempted. The transaction is either active or marked for rollback.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.610 :

Post by admin »

This has now been fixed.
Thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests