3 Replies Latest reply on Oct 17, 2002 2:33 AM by Alexey Loubyansky

    TransactionRolledbackException : Transaction XidImpl timeout

    Francine koch Newbie

      Hi,

      I have the following configuration :

      JBOS-Version: 2.4.5RC3
      Oracle: 8.1.7.2
      Solaris: 2.8

      I have the follwoing error messages in the log file :

      [12:19:32,380,TxCapsule] Transaction XidImpl [FormatId=257, GlobalId=spd-pb02.pironet-ndh.com//3800, BranchQual=] timed out. status=STATUS_ACTIVE
      [12:19:39,986,Default] Found !!
      [12:19:39,989,BeanLock] Saw rolled back tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=spd-pb02.pironet-ndh.com//3800, BranchQual=]
      [12:19:40,018,SubscriptionEntityBean] TRANSACTION ROLLBACK EXCEPTION:
      ....

      My code is the following :

      Object listref = jndiContext.lookup("news/ListEntity");
      ListEntityHome listentityhome = (ListEntityHome)
      PortableRemoteObject.narrow(listref,ListEntityHome.class);
      try{
      listEntity = listentityhome.findByPrimaryKey(listid);

      Object subref = jndiContext.lookup("news/SubscriptionEntity");

      SubscriptionEntityHome subscriptionEntityhome = SubscriptionEntityHome)
      PortableRemoteObject.narrow(subref, SubscriptionEntityHome.class);

      Collection coll = subscriptionEntityhome.findByListid(listid);
      Iterator it = coll.iterator();
      while( it.hasNext() ){
      SubscriptionEntity subscriptionentity = (SubscriptionEntity) it.next();

      ....
      }

      The findByListid should retrive around 200 elements.

      The error occurs when the SubscriptionEntity subscriptionentity = (SubscriptionEntity) it.next();
      is called.


      the ejb-jar.xml is :

      <ejb-jar>
      <display-name>NewsMailEJB</display-name>
      <enterprise-beans>

      Models a UserEntity
      <ejb-name>UserEntityBean</ejb-name>
      news.UserEntityHome
      news.UserEntity
      <ejb-class>news.UserEntityBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>news.UserEntityPK</prim-key-class>
      False
      <cmp-field><field-name>email</field-name></cmp-field>
      <cmp-field><field-name>cid</field-name></cmp-field>
      <cmp-field><field-name>firstname</field-name></cmp-field>


      Models a ListEntity
      <ejb-name>ListEntityBean</ejb-name>
      news.ListEntityHome
      news.ListEntity
      <ejb-class>news.ListEntityBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-field><field-name>listid</field-name></cmp-field>
      <cmp-field><field-name>cid</field-name></cmp-field>
      <cmp-field><field-name>title</field-name></cmp-field>
      <cmp-field><field-name>description</field-name></cmp-field>
      <primkey-field>listid</primkey-field>


      Models a ArchiveEntity
      <ejb-name>ArchiveEntityBean</ejb-name>
      news.ArchiveEntityHome
      news.ArchiveEntity
      <ejb-class>news.ArchiveEntityBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-field><field-name>archiveid</field-name></cmp-field>


      <primkey-field>archiveid</primkey-field>


      Models a SubscriptionEntity
      <ejb-name>SubscriptionEntityBean</ejb-name>
      news.SubscriptionEntityHome
      news.SubscriptionEntity
      <ejb-class>news.SubscriptionEntityBean</ejb-class>
      <prim-key-class>news.SubscriptionEntityPK</prim-key-class>
      <persistence-type>Container</persistence-type>
      False
      <cmp-field><field-name>email</field-name></cmp-field>


      <ejb-name>Mailer</ejb-name>
      news.MailerHome
      news.Mailer
      <ejb-class>news.MailerBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>


      <ejb-name>Subscription</ejb-name>
      news.SubscriptionHome
      news.Subscription
      <ejb-class>news.SubscriptionBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>
      <resource-ref>
      <res-ref-name>mail/Mail</res-ref-name>
      <res-type>javax.mail.Session</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      <assembly-descriptor>
      <container-transaction>

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

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>

      Best regards
      Francine