0 Replies Latest reply on Dec 22, 2006 3:25 AM by Peter Goetz

    Error persisting message in DB2

    Peter Goetz Newbie

      Hi there!

      I have a JBoss 4.0.3 SP1 that does JMS with MDBs. The persistance is done with DB2. There is a message sent to a topic, an MDB reacts and - as a result - sends another message to a Queue. The first message is being sent and received, it is being saved in the database (jms_messages). When the answer message should be saved it is being sent and JBoss tries to store it, but gets an SQL error from DB2, because the unique index defined in deploy/jms/-jdbc2-service.xml for the fields txop and txid is being violated. There is no transaction running, that's why the values are null and 'A' both for the already stored message for the topic and the new one for the queue.
      No my question: is this unique index neccessary? I have dropped it from the database for a test and it seemed to work. So I would like to know why there is such an index.
      The funny thing is, it worked with hsqldb (with the index). Does that mean hsqldb violates the index definition or is there some other reason for this behaviour?

      Thanks a lot for your help!

      I wish everyone of you merry christmas and a happy new year!

      Bye,

      Peter