2 Replies Latest reply on Feb 15, 2010 7:52 AM by Alexandre Mercier

    Jms transactions with jboss messaging 1.4

    Alexandre Mercier Newbie



      I'm using jboss messaging 1.4SP3 connected to a postgres 8.3 database.

      I'm trying to send a lot of messages in the same jms transaction.

      I'm getting "outofmemory" problem when doing "jms commit". Jboss messaging inserts all messages in the database when doing jms commit.

      Jboss messaging "jbm_msg_ref" database table contains "transaction_id" attribute. Is there a way to use database support for jms transaction? I mean, is there a way that jboss inserts messages one by one in database, then "global" commit using "transaction_id" (instead of keeping everything in memory and sending to DB in the end) ?


      Thanks a lot.

        • 1. Re: Jms transactions with jboss messaging 1.4
          Mayank Mittal Novice

          If I've understood your question in the right way, I think what you are trying to do is to  fire messages on transaction completion. So, I think instead of thing this job on your end.. let the container to do its job. For that.. use XAConnectionFactory to bound your JMS with JTA transaction.

            The effect of this bonding will be that fire as many as message during your process, but all will be published on the destination only when JTA transaction completes.

          • 2. Re: Jms transactions with jboss messaging 1.4
            Alexandre Mercier Newbie

            Thanks for your answer.

            But I think I'm looking for something else that maybe does not exist.

            I would prefer that each message from a transaction is commited in database when the jms "send" command is executed (with the transaction_id). But messages inserted are not "visible" from jms consumers as they are not commited from the JMS transaction point of view. When the jms commit occurs, all messages are updated in database and become visible from jms consumers.