5 Replies Latest reply on Oct 9, 2002 2:43 PM by sdixit

    CMP and transaction

    erikture

      Hello!

      When you access an CMP entity bean, does it have to be within a transaction or can it be done outside, ie readonly?

      I have am developing an application where I have a number of statless session beans and a number of CMP entity beans. The session beans is is just a layer hiding the entity beans from my jsp pages. Some methods in my session beans are updating the entity beans, but most of them are just reading the entity beans and transfering their values to the jsp pages.

      Currently I access everything using the "Required" transaction attribute. I then receivs a number of deadlocks. However if I tries to use for example the "NotSupported" transaction attribute I receive problem accessing CMR field attributes in the entity beans.

      How to get the deadlocks to disapear.
      I do not need the transactions as I most of the times does only reading.

      /Erik

        • 1. Re: CMP and transaction
          erikture

          Hello again!

          I clearly have a deadlock situation.
          On the console jboss tells me that I have two or more requests for the same resource and that they are locking each other out.

          My requests are only read requests. I am absolutly sure that no update is involved.

          How do I get the deadlocks disapear?
          I have a number of CMP entity beans with lots of relations between them. I am using Jboss 3.0.2.

          Is there some way to run inside a transaction without locking other out?

          My application will perform 99.99% reading and 0.01% updating of the database.

          Desperatly in need of help.

          /Erik

          • 2. Re: CMP and transaction, deadlock
            erikture

            Hello again!

            I clearly have a deadlock situation.
            On the console jboss tells me that I have two or more requests for the same resource and that they are locking each other out.

            My requests are only read requests. I am absolutly sure that no update is involved.

            How do I get the deadlocks disapear?
            I have a number of CMP entity beans with lots of relations between them. I am using Jboss 3.0.2.

            Is there some way to run inside a transaction without locking other out?

            My application will perform 99.99% reading and 0.01% updating of the database.

            Desperatly in need of help.

            /Erik

            • 3. Re: CMP and transaction
              erikture

              Hello again!

              I clearly have a deadlock situation.
              On the console jboss tells me that I have two or more requests for the same resource and that they are locking each other out.

              My requests are only read requests. I am absolutly sure that no update is involved.

              How do I get the deadlocks disapear?
              I have a number of CMP entity beans with lots of relations between them. I am using Jboss 3.0.2.

              Is there some way to run inside a transaction without locking other out?

              My application will perform 99.99% reading and 0.01% updating of the database.

              Desperatly in need of help.

              /Erik

              • 4. Re: CMP and transaction
                dsundstrom

                By default reads cause locks. There is a way to turn this off, but I don't know how. It is covered in the JBoss Administration Guide.

                • 5. Re: CMP and transaction
                  sdixit

                  Did anyone figure this out?

                  Sandeep