1 Reply Latest reply on Aug 21, 2006 8:50 AM by bhuste1

    Unique constraint violation with JMS

      We're getting unique constraint violations with JMS messaging and Oracle (9 & 10 we've tried both). This isn't happening often, and we're not sure what exactly is making JBoss re-use the same primary key. There is only one instance of JMS accessing the database.

      Here's the sql that JBoss uses to put a message into the database:

      INSERT INTO JMS_MESSAGE (MESSAGEID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, COREHEADERS, PAYLOAD, CHANNELCOUNT, TYPE, JMSTYPE, CORRELATIONID, CORRELATIONID_BYTES, DESTINATION_ID, REPLYTO_ID, JMSPROPERTIES) VALUES (466672, 'Y', 0, 1153260324109, '4', '', 'java.io.ByteArrayInputStream@46cf2', 1, '5', '', '', '', 0, '', '')

      Then about an hour later, another message with the same primary key was sent to the database:

      INSERT INTO JMS_MESSAGE (MESSAGEID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, COREHEADERS, PAYLOAD, CHANNELCOUNT, TYPE, JMSTYPE, CORRELATIONID, CORRELATIONID_BYTES, DESTINATION_ID, REPLYTO_ID, JMSPROPERTIES) VALUES (466672, 'Y', 0, 1153264744496, '4', '', 'java.io.ByteArrayInputStream@11a6b20', 1, '5', '', '', '', 2, '', '')

      I've searched the forums, someone else is getting the same error but not sure what DB they are using, and there weren't any ideas there.

      http://www.jboss.org/index.html?module=bb&op=viewtopic&t=85368&view=previous

      If anyone has any ideas of what would cause this I would appreciate the input.

        • 1. Re: Unique constraint violation with JMS
          bhuste1

          I am getting the exact same error using the default db hypersonic. This occurs during my long running test that I have setup to send 10 million messages from 3 different JMS clients. The test is set up to send batches of 1000 messages and sleep for 10 seconds. The messages are received by a message driven bean and a log message is created for every 1000 messages recieved. I am not performing any other business logic. After about 2 million messages, I get a NullPointer exception on the server side and a unique constraint violation on the client side.

          Any ideas here?