Hello,
I'm
testing exceptions thrown by container to the client as per table described in
MZ Guide table 10.1.
I have a plain client (public static void main) calling #1
MySesRemote.testExcept() method. This method calls another stateless bean #2
otherLocal.methodThrowsSystemEx() that throws a Runtime (system) exception.
Bean #2 runs in the transaction started by Bean #1. For bean #2 - I am in the first use-case as per MZ guide:
'Bean #2 method runs in the context of the caller's transaction'. The action is to '
Throw javax.ejb.EJBTransactionRolledbackException to client', the client being bean #1. This is what actually happens.
Since I don't start any transaction in the client, the container starts one before entering
testExcept() method.
Bean
#1 is in another use-case: '
Bean #1 method runs in the context of a transaction that the container started immediately before dispatching the business method.' For system exceptions, it should '
Throw EJBException to client.', but it does NOT - it rethrows the
EJBTransactionRolledbackException.
Any idea why? (I have noticed that EJBTransactionRolledbackException actually is a subclass of EJBExeption, but still...)