It does not matter how many times you fall,what matters is how many times you stand back.
Originally posted by Juggy Obhi:
I want to know in what Transaction Context Interceptor method would get called with T1 or T2? Since in the Books it is mentioned that Interceptor method executes in the same Transaction Context as of the Business method for which it is called.
Originally posted by Juggy Obhi:
Another think that i need to know is, in what Transaction Context the Interceptor method would get called with for a BMT Bean.
Since the Transaction Context is not marked outside the busniess method it is defined somewhere within the Bean. How do Container understand in what Transaction Context to perform the execution of Interceptor method in without touching the internals of the Business method. Since the Tx context detail is not marked as annotation above the method.
SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
It does not matter how many times you fall,what matters is how many times you stand back.
Originally posted by Juggy Obhi:
Is there any case where this is not true?
SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
Originally posted by Juggy Obhi:
Hi,
Consider we have a client with Transaction context T1 calling a Business method of a Bean with Transaction Context T2. There is one interceptor method associated with the business method.
I want to know in what Transaction Context Interceptor method would get called with T1 or T2? Since in the Books it is mentioned that Interceptor method executes in the same Transaction Context as of the Business method for which it is called.
Another think that i need to know is, in what Transaction Context the Interceptor method would get called with for a BMT Bean.
Since the Transaction Context is not marked outside the busniess method it is defined somewhere within the Bean. How do Container understand in what Transaction Context to perform the execution of Interceptor method in without touching the internals of the Business method. Since the Tx context detail is not marked as annotation above the method.
Please Guide.
SUN Certified Business Component Developer Java EE Platform 5 (2008)<br />SUN Certified Developer for Java Web Services (2007)<br />IBM WebSphere Portal V5.1 Application Development (2006)<br />SUN Certified Web Component Developer (2001)<br />SUN Certified Java 2 Programmer (2001)
Is this a nested transaction? EJB architecture does not support nested transaction.
Yes, you can begin and/or end your transaction in the interceptor method itself.
It does not matter how many times you fall,what matters is how many times you stand back.
Originally posted by Juggy Obhi:
I want to clarify one doubt. It is said that for a Stateful Session bean method committing a transaction is optional while for Stateless it is mandatory.
Will this rule apply to Interceptor method also? Like for an Interceptor method of a stateful bean its is optional to commit/end a transaction at the end of the method and for an interceptor method to a stateless session bean method it is mandatory?
In the case of a stateful session bean, it is possible that the business method that started a transaction completes without committing or rolling back the transaction. In such a case, the container must retain the association between the transaction and the instance across multiple client calls until the instance commits or rolls back the transaction. When the client invokes the next business method, the container must invoke the business method (and any applicable interceptor methods for the bean) in this transaction context.
If a stateless session bean instance starts a transaction in a business method or interceptor method, it must commit the transaction before the business method (or all its interceptor methods) returns.
SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
It does not matter how many times you fall,what matters is how many times you stand back.