Hello Good People,

We have experienced a new exception going from 3.2.0RC1 to 3.2.1
regarding CMR's under load (with MySQL and InnoDB).  Here is the
scenario: there are 2 EJB 2.0 beans using CMR, Partition and
StationGroup (there are many more, but use these two for
example). There is a 1-N relation from Partition to StationGroup, and
there is some code that retrieves the PartitionLocal from the station
group side (i.e. retrieving the 1-side local intf from the N-side
intf).  All methods in Partition and StationGroup have the "Required"
trans-attribute.  Note this problem does not occur in 3.2.0RC1, but in
3.2.1 it appears to happen in about 1/500 cases.

The problem appears to happen here--it seems that doing "partLocal =
sg.getPartition()" (N-side retrieving 1-side local) to retrieve the
PartitionLocal seems to lock and load the entire Partition bean,
however it does not appear to lock Partition properly and multiple
threads that call sg.getPartition can somehow interfere with each
other (i.e. many N-side threads call get1Side()), causing
JDBCCMRFieldBridge.FieldState to be invalidate()d and the other
threads calling sg.getPartition() from different StationGroups will
start throwing NPEs (in loadRelations typically since setHandle[0] is
then null I assume), ConcurrentModificationExceptions, when dealing
with the Partition relation data.

I'll try to come up with test case for this, being a race it is not
simple to reproduce..  It seems like a significant issue to be in a
production codebase, and I haven't been able to localize it to a
problem on the application side or find a workaround (well, yet :-).
If someone in jboss dev would like more info to help us figure this
one out we can provide more info (and perhaps additional motivation
:-).


2003-06-01 04:58:52,628 23085794 ERROR [org.jboss.ejb.plugins.LogInterceptor] 
(Job#119:)java.lang.NullPointerException
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge$FieldState.loadRelations(JDBCCMRFieldBridge.java:1544)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.load(JDBCCMRFieldBridge.java:1051)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.loadInstanceResults(JDBCCMRFieldBridge.java:1160)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:190)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:83)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:632)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getInstanceValue(JDBCCMRFieldBridge.java:565)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getValue(JDBCCMRFieldBridge.java:508)
        at 
org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:124)
        at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
        at com.five9.inf.ejb.StationGroupCMP$Proxy.getPartition(<generated>)
        at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at 
org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1044)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95)
        at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:301)
        at 
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
        at 
org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:82)
        at 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:174)
        at 
org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
        at 
org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
        at 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:483)
        at org.jboss.ejb.Container.invoke(Container.java:674)
        at 
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:353)
        at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
        at $Proxy132.getPartition(Unknown Source)

        partLocal = sg.getPartition();
...

2003-06-01 04:58:52,632 23085798 ERROR [] (Job#119) 
excjavax.ejb.TransactionRolledbackLocalException: Load failed; CausedByException is:
        null; CausedByException is:
        Load failed; CausedByException is:
        null
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:204)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
        at 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:483)
        at org.jboss.ejb.Container.invoke(Container.java:674)
        at 
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:353)
        at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
        at $Proxy132.getPartition(Unknown Source)



Andrew


-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to