I've been wrestling with a problem for almost a week now, and I'm hoping
someone may have some insight into this...

In porting our application from JBoss 2.2.2 to JBoss 3.2.1, I've found what
seems to be a major concurrency bug in JBoss.  The app consists of a session
bean acting as a facade for a set of entity beans.  Running one client
instance, the application works perfectly.  Running two or more clients at
the same time, I get an EJBException for at least one of the clients stating
"Reentrant method call detected".  In an effort to troubleshoot this
problem, created a small test application to replicate it...  Here are the
details:

Application Contents:

- One simple CMP2.0 entity bean with local interfaces.
- One stateless session bean.
- EJB application client.

App Functionality:

1. Client creates an instance of the stateless session bean.
2. Client calls a "getAll" method on the stateless session bean.
3. SSB performs a "findAll" on the entity bean.
4. SSB iterates through the finder's collection and extracts a value object
from each entity.
5. SSB returns an array of these value objects to the client.

EJB / JBoss Config:

- SSB has no transactions ("NotSupported").
- Entity "Supports" transactions (though none are used.)
- Read-ahead strategy "none" (set in "jbosscmp-jdbc.xml").
- JBoss "default" configuration, no mucking with "standardjboss.xml" or
"jboss.xml".  (This means pessimistic locking, I believe.)

What happens:

1. I start by adding 500 instances of the entity.
2. Run two clients in separate threads at the same time... (Running them in
one VM makes the problem about 90% repeatable.  Running them in separate
processes is less repeatable, presumably due to timing, but I've seen the
problem that way too.)
3. One client fails.  Relevant portions of server log (annotated):

2003-08-03 19:27:04,863 45018 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.BitRate.findAll] (RMI TCP
Connection(2)-161.218.185.41:) Executing SQL: SELECT t0_br.bitRateId FROM
BitRate t0_br
2003-08-03 19:27:04,873 45028 DEBUG
[org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] (RMI
TCP Connection(1)-161.218.185.41:) Using properties: {user=sa, password=}
2003-08-03 19:27:04,953 45108 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.BitRate.findAll] (RMI TCP
Connection(1)-161.218.185.41:) Executing SQL: SELECT t0_br.bitRateId FROM
BitRate t0_br
2003-08-03 19:27:05,124 45279 ERROR [org.jboss.ejb.plugins.LogInterceptor]
(RMI TCP Connection(1)-161.218.185.41:) EJBException:
javax.ejb.EJBException: Reentrant method call detected: BitRate 0
 at
org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInt
erceptor.java:73)
 at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterce
ptor.java:174)
 at
org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.jav
a:89)
 at
org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterce
ptor.java:53)
 at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.java:84)
 at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:273)
 at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
 at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:11
7)
 at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
 at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinde
rInterceptor.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(BaseLocalProxyFacto
ry.java:353)
 at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
 at $Proxy87.getDescription(Unknown Source)
 at
com.siemens.sea.gts.nextview.ejb.session.DefinitionEnumeratorBean.getAllBitR
ateDescriptions(DefinitionEnumeratorBean.java:97)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stateles
sSessionContainer.java:629)
 at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Cach
edConnectionInterceptor.java:186)
 at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSe
ssionInstanceInterceptor.java:72)
 at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.java:84)
 at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:216)
 at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
 at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:11
7)
 at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
 at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinde
rInterceptor.java:122)
 at
org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionConta
iner.java:322)
 at org.jboss.ejb.Container.invoke(Container.java:674)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispat
cher.java:284)
 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
 at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
 at sun.rmi.transport.Transport$1.run(Transport.java:148)
 at java.security.AccessController.doPrivileged(Native Method)
 at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
 at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
 at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
 at java.lang.Thread.run(Thread.java:536)

... This exception occurs twice for the same thread.  Only one client fails
however...

2003-08-03 19:27:05,194 45349 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.BitRate] (RMI TCP
Connection(2)-161.218.185.41:) Executing SQL: SELECT commandString,
description, verTag FROM BitRate WHERE (bitRateId=?)
2003-08-03 19:27:05,885 46040 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.BitRate] (RMI TCP
Connection(2)-161.218.185.41:) Executing SQL: SELECT commandString,
description, verTag FROM BitRate WHERE (bitRateId=?)
... etc ...


By the way, "BitRate" is the entity bean, "DefinitionEnumerator" is the
session bean.

I have also tried this test app in JBoss 3.0.4 and 3.0.7, the problem is
even worse in both of those!  (It seems to occur much more frequently on
those than in 3.2.1.)



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to