0 Replies Latest reply on Oct 12, 2002 7:08 AM by Geoff Jacobsen

    MDB not in Transaction Required mode

    Geoff Jacobsen Newbie

      Hi,

      I have been running the exercise chap=6 ex=2 from the JBossBook-3.0.3 (cool book).

      I modified the example first to throw an Error and noticed it did not rollback the transaction.

      Next I put an explicit ctx.setRollbackOnly(); and got the exception:

      java.lang.IllegalStateException: setRollbackOnly must only be called in the context of a transaction (EJB 2.0 - 15.5.1)

      I thought the MDB was implicitly in Transaction mode but for fun I added the following to the ejb-jar.xml:

      <assembly-descriptor>
      <container-transaction>

      <ejb-name>TextMDB</ejb-name>
      <method-name>onMessage</method-name>

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

      That resulted in the setRollbackOnly() not complaining and rolling back received message but NOT the reply message :(

      I also tried changing using: conn.createQueueSession(true, ...

      This looks like a bug to me; can someone confirm it?

      Also is there an option for configuring the queue to send messages that have been rolled back too many times as well as specifying how many times? Also how long they are delayed before being resent?

      Thanks
      Geoff.