Calling setRollbackOnly is a fail-safe to make sure that the TM does not try to commit the transaction. Technically since the exception is coming from the beforeCompletion phase of a Synchronization, the TM should roll the transaction back anyway. But who knows what specific TMs will do. The JTA spec itself is not entirely clear about this. You have to read the related specs (OTS, Corba, etc) to really get the full picture.
As for WebLogic.. no idea. You'd have to tias and let us know. You can see TMs like Arjuna already handle this situation "correctly" as-is.
|