0 Replies Latest reply on Dec 27, 2007 2:32 PM by Reggie Zhou

    Container keeps dropping and creating SLSB

    Reggie Zhou Newbie

      I'm using Jboss 4.2.1. MDBs asynchronized calls SLSBs. i put a counter in SLSB's constructor. so i can know the current bean comes from pool or just be created. my problem is i set max size = 100. but after the MDB receives 10,000 messages(in 10 seconds). the nuber of SLSb will be 2000 something. because the pool only holds 100 instances, i guess container destroyed those old instances and created new instance. i don't know why it doesn't keep old instances in the pool.

      MDB

      if(message instanceof ObjectMessage){
       String sessionBeanJNDI = message.getStringProperty("ApplicationName") + "LogLocal";
      
       BaseLogLocal asynchronizedLocal = logLocalMap.get(sessionBeanJNDI);
       if(asynchronizedLocal == null){
       BaseLogLocal baseLogLocal = (BaseLogLocal)cxt.lookup(sessionBeanJNDI);
       logLocalMap.put(sessionBeanJNDI, (BaseLogLocal)Asynch.getAsynchronousProxy(baseLogLocal));
       asynchronizedLocal = logLocalMap.get(sessionBeanJNDI);
       }
       ObjectMessage objectMessage = (ObjectMessage)message;
       Object object = objectMessage.getObject();
      
       asynchronizedLocal.saveLog(object, msgID);
      
       }else{
       logger.error("Not an ObjectMessage" + msgID);
       }
      


      standardjboss.xml is default.