3 Replies Latest reply on Mar 20, 2007 3:59 AM by Johan Walles

    Setting transaction timeout for onMessage()?

    Johan Walles Newbie

      Hi!

      I'm using JBoss AS 4.0.5 in EJB3 mode.

      I'd like to set the transaction timeout for one MDB's onMessage() method.

      Currently I have this:

      @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
      @TransactionTimeout(1200)
      public void onMessage(Message message)
      {
      ...
      }

      Unforturnately REQUIRES_NEW creates a new transaction (with the given timeout), but the already-active transaction still times out after the default 5 minutes. When the already-active transaction times out, the message queue thinks that we couldn't handle this message, and the message (which we've handled just fine inside the new transaction) ends up in the DLQ.

      What do I need to do to get a longer transaction for this particular onMessage() method? Without changing the default for the whole JBoss installation?

      Regards //Johan