SCBCD 1.3: 94%<br />SCWCD 1.4: 91%<br />SCJP 5: 95%
SCBCD 1.3: 94%<br />SCWCD 1.4: 91%<br />SCJP 5: 95%
SCBCD 1.3: 94%<br />SCWCD 1.4: 91%<br />SCJP 5: 95%
Originally posted by Ali Gohar:
Yes you are right setRollbackOnly is the method of UserTransaction, but EJB Specification mandates that you should not use setRollbackOnly for BMT if you will do so you will get an exception.
The reason that you don't have this method for BMT is because you have full control over transaction in BMT and you can simply rollback whenever you need.
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
SCBCD 1.3: 94%<br />SCWCD 1.4: 91%<br />SCJP 5: 95%
Are you sure about that ?
I quote HFEJB : "But if somewhere earlier in your code you can tell that the transaction is doomed, you should call setRollbackOnly()"
13.3.3.1 getRollbackOnly and setRollbackOnly Methods
An enterprise bean with bean-managed transaction demarcation must not use the getRollbackOnly
and setRollbackOnly methods of the EJBContext interface.
An enterprise bean with bean-managed transaction demarcation has no need to use these methods,
because of the following reasons:
� An enterprise bean with bean-managed transaction demarcation can obtain the status of a
transaction by using the getStatus method of the javax.transaction.User-
Transaction interface.
� An enterprise bean with bean-managed transaction demarcation can rollback a transaction
using the rollback method of the javax.transaction.UserTransaction interface.
SCBCD 1.3: 94%<br />SCWCD 1.4: 91%<br />SCJP 5: 95%
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|