1 Reply Latest reply on Dec 12, 2008 5:17 PM by clebert.suconic

    Database Unique Constraint Violation on JBM_MSG MESSAGE_ID

    jkemp83

      Our database was throwing unique constraint violations at us when we were trying to place messages on to a persistent queue. I snooped around in some of the jbm tables and noticed the MESSAGE_ID row in the JBM_COUNTER table, which appeared to be stuck at 203911168. I'm not sure if this was a max value or what, but after numerous restarts we ended up just setting this row's next_id to 1. After which everything started working again.

      Has anyone seen this behavior before? Does anyone know what could have been causing this?

      We're curious to know if we're going to need to keep resetting this value every so often or if this is a preventable issue.

      The only thing I can think of that might have generated this error is that we were sometimes deleting from the jbm_msg and jbm_msg_ref tables to clean out unwanted data during an application restart. But without knowing the low-level details of how JBoss messaging works, we're mostly just guessing here.

      Any help on this would be much appreciated.

      Thanks!

        • 1. Re: Database Unique Constraint Violation on JBM_MSG MESSAGE_
          clebert.suconic

          It seems to me that you created some failing condition at the DB.

          In my opinion you shouldn't be dealing directly with the DB in any way. you should probably be using the API to consume data you don't want.


          Regarding the maxValue issue you raised, I don't think that's possible. 203911168 is C277000 which would still be away from MAX_INT (0x7fffffff), and besides that value is a long.