4 Replies Latest reply on Jul 26, 2002 6:51 PM by Joe Simone

    transaction deadlock between 2 same clients

    Joe Simone Newbie

      Hi all,

      I have a situation where my stateless session bean has a method for creating sample data. The session is defined as:

      <transaction-type>Container</transaction-type>

      and all transaction attributes are set to

      <trans-attribute>Required</trans-attribute>

      for all the methods of all the beans.


      The method is just a for loop that calls another method in the same session which in-turn call's a single entity bean's create.

      So the test case looks like ...

      client ...> session createData --> same session addEvent --> entity's LocalHome.create(...)

      If one client is off creating sample data, it works fine.

      As soon as a second client is fired up, making sample data in the same table, I get a JDBC driver exception due to a deadlock condition. The second client get's an exception and stops.


      I believe this should work. Both clients are making data in the same table but they are not competing, or are they?

      I am using JBoss 3.0 final. Are there any currently known bugs in this area that would cause this situation?

      I am confused as to how to correct the situation. I am using CMP 2.0 throughout and letting JBoss deal with the bracketing of the transactions.

      Kind regards,
      joe

        • 1. Re: transaction deadlock between 2 same clients
          Joe Simone Newbie

          By the way, I notice NO commits in the server.log file. Is this normal?

          If I change the unit of work to be fine grained, that is many very small, quick creation's of sample data then the two client's seem to manage side by side for a couple of minutes.

          However, all is not well when both client come to a halt with an out of memory exception :


          [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
          [java] java.rmi.ServerException: null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] Embedded Exception
          [java] null; nested exception is:
          [java] java.lang.OutOfMemoryError; nested exception is:
          [java] javax.ejb.TransactionRolledbackLocalException: null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] Embedded Exception
          [java] null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] java.rmi.ServerException: null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] Embedded Exception
          [java] null; nested exception is:
          [java] java.lang.OutOfMemoryError; nested exception is:
          [java] javax.ejb.TransactionRolledbackLocalException: null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] Embedded Exception
          [java] null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] javax.ejb.TransactionRolledbackLocalException: null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] Embedded Exception
          [java] null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:240)
          [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:215)
          [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:117)
          [java] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
          [java] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)
          [java] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
          [java] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
          [java] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
          [java] at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
          [java] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
          [java] at $Proxy1.createSampleEvents(Unknown Source)
          [java] at com.highnotes.ebu.client.test.Stress_2.main(Stress_2.java:91)
          [java] javax.transaction.TransactionRolledbackException: null; nested exception is:
          [java] java.lang.OutOfMemoryError
          [java] java.lang.OutOfMemoryError
          [java] <<no stack trace available>>

          • 2. Re: transaction deadlock between 2 same clients
            Joe Simone Newbie

            More data ...

            I downloaded and installed 3.0.1RC1 from SourceForge and ran my two test clients side-by-side. Each session method invocation again creating 10 entity beans before returning to the client.

            This time client 1 ran for 820 cycles and client 2 ran for 635 cycles before the out-of-memory exception mentioned in my last post.

            If I fire up a single client by itself after this traumatic event, the server is toast! client dies after only 16 cycles with a memory exception.

            Restarting the server makes a single client go to 1435 cycles before the out-of-memory exception.

            Kind regards,
            joe

            • 3. Re: transaction deadlock between 2 same clients
              Jonathan Tobias Newbie

              What happens if you change your session bean from Stateless to Stateful?

              • 4. Re: transaction deadlock between 2 same clients
                Joe Simone Newbie

                same thing. I have tried it both, Stateful and Stateless with the same results.

                -- joe