2 Replies Latest reply on Sep 18, 2001 5:09 PM by Erik Weber

    JMD/MDB receiver + JDBC problem

    Erik Weber Newbie

      Hello. I have a JMS/MDB, and perhaps JDBC problem.

      My receiver is a MDB which receives messages containing data to be inserted into a DB. In onMessage, the MDB creates a new Session Bean which does the inserting.

      The problem is when several messages come at once which are bound for the same table (or, in some cases, even the same rows of that table). Several MDB instances are created, and several inserter Session Beans end up trying to insert into the table at the same time. This causes things to slow *way* down, and sometimes transactions even time out, as these messages can be quite large.

      What I need is a way to make sure the inserts happen one at a time. I was thinking that the best thing would be to limit the number of subscribers to that particular queue to 1, so that messages bound for the same table wait their turn in the queue instead of all being received at once. Is this possible?

      Or perhaps, they can all be received, but then the MDBs or the Session Beans are forced in some other way to do their work one at a time?

      Any help would be much appreciated.


        • 1. Re: JMD/MDB receiver + JDBC problem
          Peter Antman Expert

          If I have understood correct what others have had success with you should be able to get this behaviour by setting the MDB pool size to 1. Look into the manual how to do advanced config of MDB.


          • 2. Re: JMD/MDB receiver + JDBC problem
            Erik Weber Newbie

            Indeed, you were correct. The docs weren't very clear on this, and I still don't understand what all the elements of standardjboss.xml actually do (but sure would like to ;), but I was able to limit the number of MDB instances to one by changing the value to 1 under <container-invoker-conf>.

            It did not solve my overall problem of slow INSERT times, but it did accomplish the smaller goal. Thanks.