7 Replies Latest reply on Apr 24, 2003 9:43 AM by seven

    jdbc2.PersistenceManager and JBoss-3.2.0

    seven

      Hello,

      I am using JBoss-3.2.0 with jdbc2 PM (tryed with default hsqldb and sapdb). The problem is that when I restart the jboss server, all unconsumed messages from the JMS_MESSAGES table are deleted? Why is this happening?

      Regards,
      Horia

        • 1. Re: jdbc2.PersistenceManager and JBoss-3.2.0

          They are not persistent? Do they have a type of "T"

          Regards,
          Adrian

          • 2. Re: jdbc2.PersistenceManager and JBoss-3.2.0
            seven

            If the type u r refering to is in TXOP column, they don't:
            ----------------snip from SQuirrel Client -------------------------

            MESSAGEID DESTINATION TXID TXOP MESSAGEBLOB
            0 QUEUE.testQueue 1 A
            1 QUEUE.testQueue 2 A
            2 QUEUE.testQueue 3 A
            3 QUEUE.testQueue 4 A
            4 QUEUE.testQueue 5 A
            5 QUEUE.testQueue 6 A
            6 QUEUE.testQueue 7 A
            7 QUEUE.testQueue 8 A
            8 QUEUE.testQueue 9 A

            ----------------snip from SQuirrel Client -------------------------

            Regards,
            Horia

            • 3. Re: jdbc2.PersistenceManager and JBoss-3.2.0
              seven

              Hmmm ... After I manually updated the TXOP column with <update jms_messages set TXOP='T'> and restarted JBoss, everything was OK (the messages were there and were succesfully consumed by a remote client). So I guess this is a bug in the default configuration or in the JBoss code.

              How should I correct it?

              Regards,
              Horia

              • 4. Re: jdbc2.PersistenceManager and JBoss-3.2.0

                Did the "A" messages have txids?
                Was there a transaction in JMS_TRANSACTIONS

                It sounds like you had messages on a transaction
                that didn't commit correct?

                Regards,
                Adrian

                • 5. Re: jdbc2.PersistenceManager and JBoss-3.2.0
                  seven

                  If they didn't commit corectly, how come the messages are cosumed by clients? Here is what hypersonic writes into the script file when a message is sent:

                  -------------------------------------------------------------
                  SET AUTOCOMMIT FALSE
                  INSERT INTO JMS_TRANSACTIONS VALUES(1)
                  COMMIT
                  SET AUTOCOMMIT TRUE
                  SET AUTOCOMMIT FALSE
                  INSERT INTO JMS_MESSAGES VALUES(0,'QUEUE.testQueue',1,'A','bla...bla')
                  COMMIT
                  SET AUTOCOMMIT TRUE
                  SET AUTOCOMMIT FALSE
                  DELETE FROM JMS_TRANSACTIONS WHERE TXID=1
                  COMMIT
                  SET AUTOCOMMIT TRUE
                  -------------------------------------------------------------

                  Regards,
                  Horia

                  • 6. Re: jdbc2.PersistenceManager and JBoss-3.2.0

                    You are correct there is a problem.

                    You can fix this by changing the sql for the
                    recovery in jbossmq-service.xml

                    DELETE_MARKED_MESSAGES_WITH_TX = DELETE FROM JMS_MESSAGES WHERE TXID IN (SELECT TXID FROM JMS_TRANSACTIONS) AND TXOP=?

                    This says only delete messages that were added and
                    the transaction didn't commit.

                    Regards,
                    Adrian

                    • 7. Re: jdbc2.PersistenceManager and JBoss-3.2.0
                      seven

                      10x. This solved the problem (at least with Hypersonic, because with SapDB, at restart (with unconsumed messages) I get another exception (ClassCastException) and the queue doesn't start, but this could not be related to JBoss, but to the implementation of BLOB data type in SapDB. Anyway Hypersonic is much faster so I think I won't use SapDB for JMS persistence.

                      Regards,
                      Horia