Here at infor, we notice some suboptimalities wrt. to the current pooling
scheme. 

We try to make use of the ejbRemove()/ejbPassivate() methods in order to
release associated resources ... 

Unfortunately, it says in AbstractInstanceInterceptor:

           /**
        *   Return an instance after invocation.
        *
        *   Called in 2 cases:
        *   a) Done with finder method
        *   b) Just removed
        *
        * @param   ctx
        */
        public synchronized void free(EnterpriseContext ctx)
        {
                // Pool it
                //DEBUG      Logger.debug("Free
instance:"+ctx.getId()+"#"+ctx.getTransaction());
                ctx.clear();
                
                if (pool.size() < maxSize)
                {
                        
                        // We do not reuse but create a brand new instance
simplifies the design
                        try {
                                mReadyBean.add();
        
pool.push(create(container.createBeanClassInstance()));
                        } catch (Exception ignored) {}                  
                        //pool.push(ctx);
                } else
                {
                        discard(ctx);
                }
        }

i.e. when the pool is not yet satisfied, the ejbRemove() method is never
called on the abandoned bean instance, although a different ctx/bean
instance
is entered into the pool.

Wouldnt it be necessary to call discard(ctx), at least in the stateless bean
case, in any case?

CGJ  


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to