1 Reply Latest reply on Sep 25, 2003 12:16 PM by Adrian Brock

    JMS JDBC Persistence-Sybase-SpyJMSException "Cannot Store Me

    dvasaturo Newbie

      Hello,
      I have been able to successfully configure jboss 3.2.1 to use jdbc persistence for jms messages. The JMS_MESSAGES and JMS_TRANSACTIONS tables are properly created in Sybase. My sybase-ds.xml excerpt is below. However, when my client publishes to a durable topic "ProfileTopic", I see the following error on the console and in server.log:

      2003-09-25 13:23:37,068 WARN [org.jboss.mq.il.oil.OILServerILService] Client request resulted in a server exception:
      org.jboss.mq.SpyJMSException: Could not store message: 0 msg=0 hard NOT_STORED PERSISTENT queue=TOPIC.ishop.ProfilingTopic.ishop/ProfileEngine/DurableSubscriberID.ishop/ProfileEngine/DurableSubscriberID priority=4 hashCode=11625052; - nested throwable: (java.sql.SQLException: JZ006: Caught IOException: com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already closed.)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:685)
      at org.jboss.mq.server.PersistentQueue.addMessage(PersistentQueue.java:39)
      at org.jboss.mq.server.JMSTopic.addMessage(JMSTopic.java:283)
      at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:404)
      at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:384)
      at org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(JMSServerInterceptorSupport.java:135)
      at org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:162)
      at org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:234)
      at org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:137)
      at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:248)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: java.sql.SQLException: JZ006: Caught IOException: com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already closed.
      at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead(ErrorMessage.java:709)
      at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3071)
      at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
      at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
      at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
      at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1645)
      at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:1598)
      at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java:89)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:308)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:723)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:670)

      I have set SpecCompliant = true in transaction-service.xml. I am not sure why I am getting an error that the connection is already closed.

      Am I missing another configuration step? Any ideas would be helpful.

      Thank You.
      dv

      sybase-ds.xml excerpt...

      <local-tx-datasource>
      <jndi-name>IshopDS</jndi-name>
      <connection-url>jdbc:sybase:Tds:SDS:3000/ISHOPD</connection-url>
      <driver-class>com.sybase.jdbc2.jdbc.SybDriver</driver-class>
      <transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
      <connection-property name="user">ISHOP</connection-property>
      <connection-property name="hostname">appserver</connection-property>
      <connection-property name="applicationname">I3</connection-property>
      <user-name>user</user-name>
      xxxxx
      <min-pool-size>1</min-pool-size>
      <max-pool-size>100</max-pool-size>
      <blocking-timeout-millis>5000</blocking-timeout-millis>
      <idle-timeout-minutes>5</idle-timeout-minutes>
      </local-tx-datasource>

      jbossmq-service.xml excerpt....

      <depends optional-attribute-name="MessageCache">jboss.mq:service=MessageCache
      <depends optional-attribute-name="ConnectionManager">jboss.jca:service=LocalTxCM,name=IshopDS

      BLOB_TYPE=IMAGE
      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=? WHERE MESSAGEID=? AND DESTINATION=?
      UPDATE_MESSAGE = UPDATE JMS_MESSAGES SET MESSAGEBLOB=? WHERE MESSAGEID=? AND DESTINATION=?
      UPDATE_MARKED_MESSAGES = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=?
      UPDATE_MARKED_MESSAGES_WITH_TX = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=? AND TXID=?
      DELETE_MARKED_MESSAGES_WITH_TX = DELETE FROM JMS_MESSAGES WHERE TXID IN (SELECT TXID FROM JMS_TRANSACTIONS) AND TXOP=?
      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 INT NOT NULL, \
      DESTINATION VARCHAR(255) NOT NULL, TXID INT NULL, TXOP CHAR(1) NULL, \
      MESSAGEBLOB IMAGE NULL, CONSTRAINT JMS_MESSAGES_PK PRIMARY KEY (MESSAGEID, DESTINATION) )
      CREATE_TX_TABLE = CREATE TABLE JMS_TRANSACTIONS ( TXID INT NULL )