10 Replies Latest reply on Jul 27, 2006 3:55 AM by Peter Kaas

    Bug? Transaction timeout....

    Joey Moawad Newbie

      I have a message driven bean which is processing a transaction which cam sometimes run for hours. The main goal I am trying to acheive is to increase the transaction timeout from the default 300 seconds (5 mins) to somehere in hours. The code below demonstrates the number of things I have tried to acheive this, but I have been unsuccessful in every attempt. I am starting to think there may be a bug in one of the transaction annotations. Please help...thanks!

      - 1. Tried setting the context from setMessageDrivenContext which is called by the container. I then got the user transaction and tried to set that timeout to > 5 mins but that did not affect the 5 min default trans. timeout. (Please see commented code)

      - 2. Tried setting the @TransactionTimeout annotation to a value > 500 but that seems to do nothing...bug?

      - 3. Any other suggestions?

      public class MDBDataLoadTask implements MessageListener,MessageDrivenBean {
      private MessageDrivenContext ctx;

      public void onMessage(Message msg)
      UserTransaction aUT = ctx.getUserTransaction();

      //Perform a task that will take about this long to run
      catch (Exception e)
      catch(SystemException se){System.out.println(se.toString());}*/

      public void setMessageDrivenContext(MessageDrivenContext ctx) { this.ctx = ctx; }

      public void ejbRemove() {ctx=null;}