3 Replies Latest reply on Aug 3, 2003 12:26 AM by F Zemen

    locking issues

    Grzegorz Stelmaszek Newbie


      In our web application we had problems with locks and deadlocks.

      Basically in one transaction we do the following:
      * fetch contencts of one table (that is a menu table)
      * do other stuff

      In our test we issue read-only queries only, but in real-life we use read-write access, so switchting to read-only for entity is not possible.

      The problem is that with the PessimisticLocking, a lock is set on every bean reflecting menu table, and thus only one client at a time is processed :(.

      This is really bad for us.

      So we switched off locking (relaying only on db locks) by setting to NoLock policy. We got reentrant errors :( (that is quite clear yet).

      So we switched to OptimisticLocking. But with:
      * modified-strategry - we get reentrant errors - WHY??
      * read-strategy weird things are happening, as we get ObjectNotFoundExceptions and 'IllegalStateException: A CMR collection may only be used within the transction in which it was created' that points us to the thinking that our entity beans content is being modified during single transaction. But we do not issue updates! So WHY this happens???

      All the above problems does not occur when only one client at a time is using our application.

      Is it other way to set 'read commited' isolation level in jboss?

      best regards,