A bean realizes it cannot commit a transaction,but it does not want the client to get an exception.what can the bean do?
A bean wants the client to get an application exception but the bean still wants the transaction to commit.what should bean do?
I can think of this,
If the bean throws system exception, transaction will rollback and an exception will be thrown to client. We dont want this.
The only way is to call setRollbackOnly() and mark the transaction to rollback.
Regarding the second one,
If our method has declared the application exception in the signature
and throws it, the container will not rollback the transaction and
throw the exception to client.
What do you think? Is it right?