2 Replies Latest reply on Nov 7, 2002 1:36 PM by Shashi Rai

    Help needed with setRollbackOnly

    Shashi Rai Newbie

      it Hi,

      I get following exception message when I call context.setRollbackOnly on my MDB.
      In JBOSS 3.0.0: MDB is not allowed to call setRollbackOnly unless tx type is REQUIRED

      In JBOSS 3.0.4: setRollbackOnly must only be called in the context of a transaction (EJB 2.0 - 15.5.1)
      I have trans-attribute is set as Required.

      Any clue what I am missing. Thanks for help. Here is the ejb-jar.xml:

      <ejb-jar>
      <enterprise-beans>
      <message-driven>
      <ejb-name>ForgotPasswordMDB</ejb-name>
      <ejb-class>com.efi.apps.flypaper.listeners.mdb.ForgotPasswordBean</ejb-class>
      <transaction-type>Container</transaction-type>
      <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
      <message-driven-destination>
      <destination-type>javax.jms.Queue</destination-type>
      </message-driven-destination>
      </message-driven>

      <assembly-descriptor>
      <container-transaction>

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

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