2 Replies Latest reply on Apr 3, 2004 4:27 AM by Alexey Loubyansky

    Could not create two instances of the same entity at the sam

    snicoll@kiala.com Newbie


      We have an application that create entities (let's say a Book) when some message is send to a queue. An MDB picks up the message, translate its content and create a new entity with the value contained in this XML.

      Most of the time, the message contains an array of Books to create.

      When playing with thread dump and stuff llike that I discovered something I couldn't explain.

      Jboss 3.2.3 / Instance Per Transaction container /JDK 1.4.2
      Redhat 9
      Postgres 7.3.4

      5 messages are sent on this queue containing 50 "create-book" instructions each.

      5 MDBS are then instanciated and starts parsing the message. Then 4 of them are locked till the first one complete. Once the second one complete, the third one starts processing.

      Using a thread dump, the 4 threads (MDB threads) waits on the create() method of the Book's session facade. How can I configure my system so that I can create two books at the same time within two different transactions.