Forums Register Login

Pg 487 on HFEJB

+Pie Number of slices to send: Send
On Page 487, it's written that :

A bean that calls setRollbackOnly() must be in a transaction.

The questions are:

- What would happen if a bean calling setRollbackOnly() is NOT in a transaction? Does it throw some exception? If yes which one?
- Does the above type of constraint applies to the other methods as well? (getRollbackOnly(), getStatus(), ...)?
+Pie Number of slices to send: Send
It throws IllegalStateException.

These methods are available in EJBContext class.
some of the methods works in certain type of beans and also depends on the status of the bean (i.e whether the bean is in trasaction or not).

If the criteria to call that method is not met then it throws IllegalStateException
You may have just won ten million dollars! Or, maybe a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 450 times.
Similar Threads
rollback() vs setRollbackOnly()
Does the container call setRollbackOnly() method?
all container call backs are invoked in unspecified transaction?
Difference between rollback() & setRollbackOnly()
EJB 2 BMT
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:29:08.