3 Replies Latest reply on Nov 13, 2002 10:11 PM by manishsharan

    help : jdbc2.PersistenceManager in 3.0.4 with hsqldb

    manishsharan

      Hi ,

      My application works fine with the default persistence manager (org.jboss.mq.pm.file.PersistenceManager) but when I tried using the jdbc2 PersistenceManager and I got a bunch of errors :

      2002-11-13 18:00:46,087 ERROR [org.jboss.jms.asf.StdServerSession] failed to commit/rollback
      javax.transaction.xa.XAException
      at org.jboss.mq.SpyXAResource.commit(SpyXAResource.java:100)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:294)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:603)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:417)
      at org.jboss.mq.SpySession.run(SpySession.java:296)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:178)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:655)
      at java.lang.Thread.run(Thread.java:536)

      All I did to use the jdbc2 Persistence Manager was to un-comment the Mbean section for org.jboss.mq.pm.jdbc2.PersistenceManager and comment out the mbean section for org.jboss.mq.pm.file.PersistenceManager in the jbossmq-service.xml file.

      I reverted back to the file persistence and my application is now once again working fine. But I wish to use the jdbc2 persistence manager. Is this a bug in 3.0.4 or is there some parameter that I need to configure somewhere. ?

      Thanks your help !!

      Regards
      -m

        • 1. Re: help : jdbc2.PersistenceManager in 3.0.4 with hsqldb
          manishsharan

          I tried this in 3.0.3 and I get the same problem. I am convinced this cannot be a bug (pre-release unit tests would have caught it )but a misconfiguration on my end. Can someone please tell me what else do I need to do to make this work ?

          This is what my jbossmq-service.xml looks like wehn I try to use the jdbc2 persistence manager.

          <!-- The PersistenceManager is used to store messages to disk.

          db/jbossmq/file
          <depends optional-attribute-name="MessageCache">jboss.mq:service=MessageCache




          | The jdbc2 PersistenceManager is the new improved JDBC implementation.
          | This implementation allows you to control how messages are stored in
          | the database.
          |
          | Use this PM if you want the reliablity a relational database can offer
          | you. The default configuration is known to work with hsqldb, other databases
          | will requrie teaking of the SqlProperties.

          -->


          <depends optional-attribute-name="MessageCache">jboss.mq:service=MessageCache
          <depends optional-attribute-name="DataSource">jboss.jca:service=LocalTxDS,name=hsqldbDS
          jboss.jca:service=LocalTxCM,name=hsqldbDS

          BLOB_TYPE=OBJECT_BLOB
          INSERT_TX = INSERT INTO JMS_TRANSACTIONS (TXID) values(?)
          INSERT_MESSAGE = INSERT INTO JMS_MESSAGES (MESSAGEID, DESTINATION, MESSAGEBLOB, TXID, TXOP) VALUES(?,?,?,?,?)
          SELECT_ALL_UNCOMMITED_TXS = SELECT TXID FROM JMS_TRANSACTIONS
          SELECT_MAX_TX = SELECT MAX(TXID) FROM JMS_MESSAGES
          SELECT_MESSAGES_IN_DEST = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE DESTINATION=?
          SELECT_MESSAGE = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
          MARK_MESSAGE = UPDATE JMS_MESSAGES SET (TXID, TXOP) VALUES(?,?) WHERE MESSAGEID=? AND DESTINATION=?
          DELETE_ALL_MESSAGE_WITH_TX = DELETE FROM JMS_MESSAGES WHERE TXID=?
          DELETE_TX = DELETE FROM JMS_TRANSACTIONS WHERE TXID = ?
          DELETE_MARKED_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXID=? AND TXOP=?
          DELETE_MESSAGE = DELETE FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
          CREATE_MESSAGE_TABLE = CREATE TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, \
          DESTINATION VARCHAR(50) NOT NULL, TXID INTEGER, TXOP CHAR(1), \
          MESSAGEBLOB OBJECT, PRIMARY KEY (MESSAGEID, DESTINATION) )
          CREATE_TX_TABLE = CREATE TABLE JMS_TRANSACTIONS ( TXID INTEGER )



          • 2. Re: help : jdbc2.PersistenceManager in 3.0.4 with hsqldb

            This is wrong

            MARK_MESSAGE = UPDATE JMS_MESSAGES SET (TXID, TXOP) VALUES(?,?)

            This is correct

            MARK_MESSAGE = UPDATE JMS_MESSAGES SET TXID=?, TXOP=?

            Regards,
            Adrian

            • 3. Re: help : jdbc2.PersistenceManager in 3.0.4 with hsqldb
              manishsharan

              Thank You ! Thank You !! It worked. I changed the statement as you suggested and its working !

              Regards
              -m