• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

deadlock exception

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
dragon ji
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
java.lang.reflect.UndeclaredThrowableException
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(NonReentrantLock.java:81)
at org.jboss.ejb.plugins.lock.NonReentrantLock.attempt(NonReentrantLock.java:105)
at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:82)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:163)
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:54)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
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:489)
at org.jboss.ejb.Container.invoke(Container.java:700)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
... 94 more
 
dragon ji
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did some modification as following:

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

<container-configurations>
<container-configuration extends="Instance Per Transaction CMP 2.x EntityBean">
<container-name>Optimistic CMP EntityBean</container-name>
<locking-policy>org.jboss.ejb.plugins.lock.JDBCOptimisticLock</locking-policy>
<commit-option>B</commit-option>
</container-configuration>
</container-configurations>

then shift the special bean to this configuration.

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

<load-groups>
<load-group>
<load-group-name>wo</load-group-name>
<field-name>statusDicId</field-name>
<field-name>plannedStartDateTime</field-name>
</load-group>
</load-groups>

<optimistic-locking>
<group-name>wo</group-name>
</optimistic-locking>
</entity>

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

then my system passed the test of loadrunner.
 
reply
    Bookmark Topic Watch Topic
  • New Topic