1 Reply Latest reply on Jul 3, 2003 6:09 PM by vanitas

    deadlocks

    vivek.chaudhri

      Hello:

      I am using JBoss 3.0.0 and using CMP as my persistence mechanism on Oracle 8.1.7. I mark all my getter methods to be read-only on jboss.xml. I see deadlocks when accessing getter methods. I am not sure what will be causing this. I thought that marking the method read-only would solve deadlock problems. The stack trace for the deadlock says that the deadlock is happening when executing a getter method which I said I tagged them as read-only.

      Could anyone please enlighten me what I may be doing wrong. Is there any other way to change the locking mechanism. In the stack trace I also see that I am using pessimistic locking. Is there a way I an tell the container to use optimistic locking. If so, would that solve my deadlock problems. Also I am using commit-option A. That should have resulted in less situation for deadlocks but I am not seeing that. In my application I am mosting doing reads and do very few writes to the database.

      All help will be greatly appreciated.

      Thanks
      Vivek

        • 1. Re: deadlocks
          vanitas

          Hi,

          I'm also fighting with locking now :).

          It's possible to change locking to optimistic. To do so you shall change locking-policy in your conatiner-configuration (standardjboss.xml). Possible values are JDBCOptimisticLocking, NoLock, SimpleEjbReadWrite and Pessimistic (I might have typoed the exact names - take a look in classes in package org.jboss.plugins.lock in jboss.jar).

          To use optimistic locking you must also define strategy for it (search forum for 'optimistic locking' for details).

          But all the above did not solve my deadlock problems :(. I switched to a different containter-configuration (the one using EntityMultiInstanceInterceptor). The problem is that this interceptor does seem to ignore caching :( at least on my jboss.

          Hope this helped :)
          greg