users@glassfish.java.net

There are some questions about The Improvement of

From: <forums_at_java.net>
Date: Fri, 1 Mar 2013 16:48:21 -0600 (CST)

Hi I have some questions about the following method in glassfish V3:
-------------------------------------------------------------------------------------------------
Component: ejb_container class: com.sun.ejb.containers.BaseContainer
method:postInvoke(invocation inv, boolean doTxProcessing)
postInvoke(Invocation inv, boolean doTxProcessing) { ...... if ( inv.ejb !=
null ) { // counterpart of invocationManager.preInvoke if (! inv.useFastPath)
{ invocationManager.postInvoke(inv); if (isStatefulSession &&
(((EJBContextImpl) inv.context).getTransaction() != null)) {
SessionContextImpl sessionCtx = (SessionContextImpl) inv.context;
JavaEETransaction j2eeTx = (JavaEETransaction) sessionCtx .getTransaction();
Map entityManagerMap = sessionCtx .getExtendedEntityManagerMap(); for
(EntityManagerFactory emf : entityManagerMap.keySet()) { if
(sessionCtx.isEmfRegisteredWithTx(emf)) {
j2eeTx.removeExtendedEntityManagerMapping(emf);
sessionCtx.setEmfRegisteredWithTx(emf, false); } } } } else { doTxProcessing
= doTxProcessing && (inv.exception != null); } try { if( doTxProcessing ) {
postInvokeTx(inv); } } catch (Exception ex) { _logger.log(Level.FINE,
"ejb.postinvoketx_exception", ex); } ...... }
------------------------------------------------------------------ glassfish
V2 compare with glassfish V3 it has some changes, changes as following: the
logic of the method In glassfish V2: 1:first execute the following code
---------------------------------- if ( doTxProcessing ) { postInvokeTx(inv);
} ---------------------------------- 2: then execute the following code:
---------------------------------- invocationManager.postInvoke(inv);
---------------------------------- the logic of the method In glassfish V3:
1:first execute the following code ----------------------------------
invocationManager.postInvoke(inv); ---------------------------------- 2: then
execute the following code: ---------------------------------- if (
doTxProcessing ) { postInvokeTx(inv); } ----------------------------------
Why do this change? If I execute the following code in glassfish V3 ,what
will happen? 1:first execute the following code
---------------------------------- if ( doTxProcessing ) { postInvokeTx(inv);
} ---------------------------------- 2: then execute the following code:
---------------------------------- invocationManager.postInvoke(inv);
----------------------------------

--
[Message sent by forum member 'jifeng']
View Post: http://forums.java.net/node/895341