2 Replies Latest reply on Oct 8, 2002 5:43 AM by seven

    Deadlock on READ? How to configure?

    seven

      Hello all.

      I have a method of a facade session bean (stateless) that only accesses (by reading) 2 entity beans instances (with pk1 and pk2, in this order). The same method, is some other situations (business requirements) accesses the same 2 entity beans instaces, but in the reverse order (pk2 and pk1 respectively). When to parallel clients call the facade method(client A calls with pk1,pk2 and client B calls pk2,pk1), I get a DEADLOCK.

      My question is: are the entity beans locked within the tx started by the session bean method, even if the entity beans methods called are "get" methods? If so, how can I configure jboss in order NOT to lock the entity beans when read only methods ("get" methods) are called upon them?

      I guess that if posible, the "get" methods should return not commited data of the entity bean.

      Thanks.

        • 1. Re: Deadlock on READ? How to configure?
          minamoto

          According to the JBossBook 3, you can define your entity bean
          or their methods separately as read-only in jboss.xml.

          I see the read-only element only in the jboss_3_1.dtd of jboss 3.2beta.

          Miki

          • 2. Re: Deadlock on READ? How to configure?
            seven

            Yep. I guess we should wait until they (jboss ppl) make up their minds, 'cause I tested the <read-only> tag at method level with jboss-3.0.3 and it has no effect. I learned that there is a new </locking-policy>org.jboss.ejb.plugins.lock.NoLock</locking-policy>, but I have no ideea what it does.