A bean realises it cant commit a transaction ,but it does'nt want the client to get an exception.what can the bean do? what does the question mean? I think....there is a TransactionRolledBackException() if the caller is also is in the same context...so use a try/catch to catch the exception and not let the exception propagate to the container ..and then to the client.am I correct? please throw some light thanks Pradeep
Failure is not when you fall down; its only when you fail to get up again.
A bean realises it cant commit a transaction ,but it does'nt want the client to get an exception.what can the bean do?
You can simply invoke setRollbackOnly() on EJBContext . Transaction is rolledback in two ways: - bean throws system exception - very bad way (the bean is dead) - invoke setRollnackOnly() on EJBContext for CMT || invoke getUserTransaction().setRollbackOnly() for BMT.