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.

      -Erik