SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
(1) I disagree because TransactionRequiredException is a system exception
(2) In pratice, when will the client receve a TransactionRolledBackException ?
quote:
(1) I disagree because TransactionRequiredException is a system exception
-TransactionRequiredException is a system exception
-Anyway, the client would get this exception, there's nothing wrong with a system exception
see also Javadoc: This exception indicates that a request carried a null transaction context, but the target object requires an active transaction.
severin
quote:
(2) In pratice, when will the client receve a TransactionRolledBackException ?
Surely you mean javax.transaction.TransactionRolledbackException (not extended byjavax.jms.TransactionRolledBackException):
You will get this exception in a remote client if the business method marks the method as "rollback only", for example.JavaDoc says:
This exception indicates that the transaction associated with processing of the request has been rolled back, or it has been marked to roll back. Thus the requested operation either could not be performed or was not performed because further computation on behalf of the transaction would be fruitless.
Severin
Originally posted by Ryan Wong:
I believe what Vinicius Boson is trying to say is that in HFEJB, it mentions that if a System Exception is encountered, the Container will send it as a RemoteException or EJBException if the client is local.
SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
Originally posted by Ryan Wong:
Adding to Severin's reply, a client will get this Exception if the Bean encountered a system exception if the method is run in the callers transaction.
SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
Originally posted by Vinicius Boson:
But i reliazed that it�s the opposite, right ? When the client gets a non system exception that he can�t know if the transaction was rolled back because the container passes to the client the same exception throwed.
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Originally posted by Marco Tedone:
As far as I know the container doesn't rollback a transaction if a checked exception was thrown. It will do that only in the case of a runtime exception on the server side, together with logging the exception, killing the bean and throwing a RemoteException (or subclass) to remote clients, and EJBException to local clients.
SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
I thought that i read in HFEJB that if a client receve a RemoteException (or EJBException for local clients) the client wouldn�t know if the transaction was rolled back.
But i reliazed that it�s the opposite, right ? When the client gets a non system exception that he can�t know if the transaction was rolled back because the container passes to the client the same exception throwed.
But if the client receve a RemoteException (a system exception) he knows for sure that if there was an transaction, it was rolled back. My point was that if a client recebe a checked exception, he won�t know if the transaction was rolled back because it�s up to bean provider rolls it back, right ?