0 Replies Latest reply on Oct 6, 2003 2:52 PM by the_bone_ranger

    Deadlock detection broken?

    the_bone_ranger Newbie

      The problem is client apps would freeze.

      I use swing clients connecting to a servlet via http.
      The servlet runs in jboss-3.2.2RC4.
      This in turn, calls a session bean which calls CMP entity beans etc.

      The blocking appears to occur on the database. I did a kill -3 on jboss, and this is one of the hung threads.

      Looks like deadlock at the database level, if so, why didn't the deadlock detection pick it up?
      I have subsequently done deadlock tests (i.e. purposely creting deadlock), and the deadlock detection picks it up everytime.

      This case happened after the server had been running for a couple of weeks.

      Note, my code is simple, I'm not using any synchronization primitaves or anything dodgy.
      I'm using purely CMP and not coding any jdbc calls directly.





      "Thread-7" daemon prio=1 tid=0x4f0606c8 nid=0x5dfa waiting on condition [4f2a9000..4f2ab714]
      at com.mysql.jdbc.Field.(Field.java:100)
      at com.mysql.jdbc.MysqlIO.unpackField(MysqlIO.java:1190)
      at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:252)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:985)
      at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:917)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:1841)
      - locked <0x46e81288> (a java.lang.Object)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:1775)
      at com.mysql.jdbc.Statement.executeQuery(Statement.java:1220)
      - locked <0x46e81288> (a java.lang.Object)
      - locked <0x46e8d608> (a com.mysql.jdbc.Statement)
      at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:2288)
      at com.mysql.jdbc.Connection.createNewIO(Connection.java:1548)
      at com.mysql.jdbc.Connection.(Connection.java:486)
      at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:326)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:143)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:372)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:185)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:459)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:417)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:317)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:469)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:800)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:135)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:93)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:49)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:593)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:299)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:300)
      at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:636)
      at sun.reflect.GeneratedMethodAccessor40.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.invokeHome(EntityContainer.java:1042)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:185)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:214)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:91)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:349)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:484)
      at org.jboss.ejb.Container.invoke(Container.java:720)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:293)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy48.findByPrimaryKey(Unknown Source)