1 Reply Latest reply on Sep 7, 2009 3:40 AM by Markus Lutum

    Qeustion on transactions and restarting the Server

    Markus Lutum Novice

      Hi Howard!

      I have problems to explain the following problem:
      (JBM1.4 build 7798 with OderingGroup enabled via CF)
      (But I think OG has nothing to do with it)

      I have a consumer which get one message transacted like this

      ...
      @Resource(mappedName="java:/JmsXA")
      private ConnectionFactory cf;
      ...
      Connection connection = cf.createConnection();
      connection.start();
      ...
      Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
      MessageConsumer consumer = session.createConsumer(m_queue);
      Message msg = consumer.receive(20000);
      


      Now I do the following:
      - Message is received
      - While I handle the message (in the transaction) i kill the Server (real kill)

      After I restart my server my consumer will NOT get the same message again. It gets the next one.
      If I look into the jbm_msg_ref I see one message
      with Transaction_ID 41157221480464402 and state "-" and one entry in the tx table.
      As I can see this message stays there forever.

      Whats the problem or the reason here?
      In my case this message must be retried again until the maxdeliverycount is reached and then the next must be delivered.
      So in my case this scrambles my order.





        • 1. Re: Qeustion on transactions and restarting the Server
          Markus Lutum Novice

          I can reproduce it if I add a breakpoint at the JDBCPersistenceManager after the tx records are added to the Database.

          I I then kill the server the message stays there forever.
          My jta Recovery also ignores it!

          I don't know but is it an option to remove the TX states while startup?

          Greets
          Markus

          Stacktrace where I add my breakpoint:

          JDBCPersistenceManager$1HandleBeforePrepareRunner.doTransaction() line: 1958
          JDBCPersistenceManager$1HandleBeforePrepareRunner(JDBCSupport$JDBCTxRunner2<T>).execute() line: 474
          JDBCPersistenceManager$1HandleBeforePrepareRunner(JDBCSupport$JDBCTxRunner2<T>).executeWithRetry() line: 512
          JDBCPersistenceManager.handleBeforePrepare(List, List, Transaction) line: 2077
          JDBCPersistenceManager$TransactionCallback.beforePrepare() line: 2998
          Transaction.prepare() line: 265
          ServerConnectionEndpoint.sendTransaction(TransactionRequest, boolean) line: 509
          ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$sendTransaction$aop(TransactionRequest, boolean) line: 101
          ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext() line: not available
          SecurityAspect.handleSendTransaction(Invocation) line: 195
          GeneratedMethodAccessor89.invoke(Object, Object[]) line: not available
          DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
          Method.invoke(Object, Object...) line: 597
          PerInstanceAdvice.invoke(Invocation) line: 121
          ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext() line: not available
          ServerLogInterceptor.invoke(Invocation) line: 105
          ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext() line: not available
          ConnectionAdvised.sendTransaction(TransactionRequest, boolean) line: not available
          ConnectionSendTransactionRequest.serverInvoke() line: 82
          JMSServerInvocationHandler.invoke(InvocationRequest) line: 157
          SSLBisocketServerInvoker(ServerInvoker).invoke(InvocationRequest) line: 862
          ServerThread.processInvocation(SocketWrapper) line: 609
          ServerThread.dorun() line: 421
          ServerThread.run() line: 174
          

          I let the JDBCSupport$JDBCTxRunner2 do the commit (Line 476) before I kill the Jboss Server.