permaculture playing cards
The moose likes JBoss/WildFly and the fly likes deadlock exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "deadlock exception" Watch "deadlock exception" New topic

deadlock exception

dragon ji
Ranch Hand

Joined: Oct 31, 2002
Posts: 110
jboss3.2.3 sql server 2000

I have a timertask, run in background regularly. it will visit an entity bean, suppose A.

And also there are other places visit that bean.

all the methods are 'required' configuration. the isolation level is pessimistic

now I often met deadlock exception.

How do I resolve this problem?

scjp 1.4<br />challenge haven't limit!
dragon ji
Ranch Hand

Joined: Oct 31, 2002
Posts: 110
I change the lock to JDBCOptimisticLock by modify standardjboss.xml, the deadlock disappear. but new error happend. the exception is:
2005-01-12 10:44:49,147 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
at $Proxy189.getId(Unknown Source)
Caused by: java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at org.jboss.ejb.plugins.lock.NonReentrantLock.acquire(
at org.jboss.ejb.plugins.lock.NonReentrantLock.attempt(
at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(
at org.jboss.ejb.plugins.LogInterceptor.invoke(
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(
at org.jboss.ejb.EntityContainer.internalInvoke(
at org.jboss.ejb.Container.invoke(
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(
at org.jboss.ejb.plugins.local.EntityProxy.invoke(
... 94 more
dragon ji
Ranch Hand

Joined: Oct 31, 2002
Posts: 110
I did some modification as following:

1: modify jboss.xml, add one container configuration as following:

<container-configuration extends="Instance Per Transaction CMP 2.x EntityBean">
<container-name>Optimistic CMP EntityBean</container-name>

then shift the special bean to this configuration.

2: configure locking policy for the special bean in jbosscmp-jdbc.xml.



3: add synchronize in some places which shouldn't be concurrent invoking.

then my system passed the test of loadrunner.
I agree. Here's the link:
subject: deadlock exception
jQuery in Action, 3rd edition