[jboss-dev-forums] [Design of the JBoss EJB Container] - Re: JBAS-4304 - Jboss calls ejbStore inside ejbPostCreate on

adrian@jboss.org do-not-reply at jboss.com
Thu Apr 5 09:55:32 EDT 2007


There are two ways to fix this problem that I can see.

1) Delay the registration of the context with the GlobalTxEntityMap until ejbPostCreate()
returns.

The disadvantage is that this will require retesting of the locking and caching to
make sure we have caught all the cases where delaying the registration of the
synchronization with the transaction does not get an automatic tidyup.
e.g. tx timeout during ejbPostCreate() will not invoke the synchronization anymore

2) Does some fixup to the state of the EntityEnterpriseContext such that
the GlobalTxEntityMap knows not to flush the entity until after the ejbPostCreate
has returned.
e.g. We could in EntitySynchronizationInterceptor do
instance.setTxAssociation(SYNCHRONIZED)
in the invokeHome() and reset it to the default NONE after ejbPostCreate()

This second option would tell the GlobalTxEntityMap that the data is already
synchronized and doesn't need to be flushed, 
but this might not interplay very well with the "insertAfterEjbPostCreate" feature of CMP?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035014#4035014

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035014



More information about the jboss-dev-forums mailing list