2 Replies Latest reply on Nov 22, 2002 2:03 PM by Jeff Gettle

    SQLException from org.jboss.mq.pm.jdbc2.PersistenceManager

    Jeff Gettle Newbie

      Hi,

      We are using JBoss 3.0.4. We are using the jdbc2 PersistenceManager to store JMS messages in the database. We have a queue that has 25,000 messages in it and they are fairly large (about 8k each). When we restart JBoss we get the following SQLExSQLException from the PersistenceManager when it is trying to restore the queue:

      org.jboss.mq.SpyJMSException: Could not store message: 1010170; - nested throwable: (java.sql.SQLException: ORA-00001: unique constraint (JMS_MESSAGES_MSGID_DEST2) violated
      )
      at org.jboss.mq.pm.jdbc2.PersistenceManager.saveToStorage(PersistenceManager.java:1048)
      at org.jboss.mq.server.MessageCache.saveToStorage(MessageCache.java:250)
      at org.jboss.mq.server.MessageReference.makeSoft(MessageReference.java:159)
      at org.jboss.mq.server.MessageCache.validateSoftReferenceDepth(MessageCache.java:208)
      at org.jboss.mq.server.MessageCache.add(MessageCache.java:84)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.restoreQueue(PersistenceManager.java:381)
      at org.jboss.mq.server.JMSDestinationManager.addDestination(JMSDestinationManager.java:786)
      at org.jboss.mq.server.jmx.Queue.startService(Queue.java:66)
      Caused by: java.sql.SQLException: ORA-00001: unique constraint (JMS_MESSAGES_MSGID_DEST2) violated
      SQLException from org.jboss.mq.pm.jdbc2.PersistenceManager
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321)
      at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java:1741)
      at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java:1902)
      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
      at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeUpdate(LocalPreparedStatement.java:308)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:758)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.saveToStorage(PersistenceManager.java:1036)
      ... 75 more

      I think the MessageCache is telling the CacheStore to saveToStorage but since the PersistenceManger is the CacheStore and all the messages are already in the database we get a SQLException because the message id primary key is being violated. I'm not sure what the overall problem is or how to fix it.

      I'd be greatful for an insight.

      Thanks
      Jeff