1 Reply Latest reply on May 27, 2006 2:31 PM by lkowalczyk

    NonReentrantLock problems with multithreaded MDB execution

    lkowalczyk

      The below description pertains to JBoss 3.2.7.

      We've encountered a strange reentrancy problem which we currently link to some glitch in the concurrent execution of session and entity beans from the onMessage method in our MDB bean.

      The MDB receives messages at a rate that forces JBoss to fire off multiple execution threads (maybe tens of threads at a time). The MDB then calls a session bean which in turn makes extensive use of entities.

      At this time, NonReentrantLock exceptions start showing up in the logs (the attempt() method). Now, I am familiar with the usual cause of such exceptions (ie. bean A calling bean B calling bean A) and I performed code audit which turned up nothing.

      The interesting thing is, the exceptions started being thrown when we had substantially sped up the database connection. We've never had this problem before when the database network connection overhead caused a simple SELECT query to take about 1 sec.

      Could this be a problem with the caches used in the NonReentrantLock? If this is the problem with our code, what should I be on the lookout for in the first place?