0 Replies Latest reply on Feb 25, 2004 7:20 AM by demarco

    Transaction deadlock detection don't work.

      Hi together.
      We're using JBOSS 3.0.0. with BMP and SAPDB.
      I've tried the following small situation.

      SessionBean with 2 functions:
      - methode testA{}
      doing a finder-method and selecting beans from 1 to 1000
      deleting these 1000 EJBs
      - methode testB{}
      doing a finder-method and selecting beans from 1000 to 2000
      simply modifing an attribute of the beans

      2 clients will be startet, one calling method A and 1 calling method B.
      The client calling method B is called first.

      So, Method B will changes an attribute of EJB 1000.
      Also Methode A selects this Beans in the finder and tries do delete this bean. Now JBOSS is not blocking this request (Thread A). The remove seams to work and at the end of the two threads (during commit) boths threads are blocking.
      I#ve tried it also with JBoss 3.2.2 RC4.

      Any ideas how to configure JBoss to prevent this situation.
      Thanks for Help.

      Method A
      public void testA(){
      ......
      Collection list = this.testLocalHome.findAllByIdRange(1, 1000);
      Iterator i = list.iterator();
      while(i.hasNext()){
      TestLocal local = (TestLocal)i.next();
      local.remove();
      }
      }

      public void testB(){
      ......
      Collection list = this.testLocalHome.findAllByIdRange(1000, 2000);
      Iterator i = list.iterator();
      while(i.hasNext()){
      TestLocal local = (TestLocal)i.next();
      local.setName("Hallo");
      }
      }

      deployment settings:


      <![CDATA[]]>

      <ejb-name>Test</ejb-name>

      <local-home>test.TestLocalHome</local-home>
      test.TestLocal

      <ejb-class>test.TestBMP</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>test.TestPK</prim-key-class>
      False

      <resource-ref >
      <res-ref-name>jdbc/SAPDBDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>





      <container-transaction >

      <ejb-name>Test</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      <container-transaction >

      <ejb-name>TestSession</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>

      BMPs defiend in commit-option A.