ejbRemove is called only when the bean is being removed from the datastore.
This is never invoked by the container.  You're thinking of ejbPassivate.


Instances are not returned to the pool because we determined that there were
a few unfound bugs in the code.  It may be reinstated later.


Bill

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Peter
> Antman
> Sent: Monday, September 17, 2001 9:01 AM
> To: [EMAIL PROTECTED]
> Subject: [JBoss-dev] 2.4.1 instance pool and ejbCreate/Remove
>
>
> Hi,
> I have to admit I am a little lost here. In the messaging forum a user
> have wondered why ejbCreate is called every time the bean is accessed,
> but never ejbRemove.
>
> In one of his examples sending 1000 messages he gets this:
>
> 1) 1001 calls to ejbCreate()
> 2) 1000 calls to onMessage()
> 3) Zero calls to ejbRemove()
>
> With an instence pool of 100 this does not seem reasonably. I checked
> with a somewhat old 2.4.(1) CVS version, but could not verrify the
> error. Then I downloaded the 2.4.1 binary, and yes, there it was.
>
> Looking into the code I found the following new stuff in
> AbstractInstancePool.free():
>
>  if (pool.size() < maxSize)
>       {
>
>          // We do not reuse but create a brand new instance
> simplifies the design
>          try {
>             pool.push(create(container.createBeanClassInstance()));
>          } catch (Exception ignored) {}
>          //pool.push(ctx);
>       } else
>       {
>          discard(ctx);
>       }
>
> To me this does not look ok. If we look at the examples statistics I
> would guess he have serial behaviour. One actual object in the pool, but
> will have ejbCreate called in free (1000 times), which calles create,
> which created a new MDB container (same is vallid for Stateless
> Session), which calles ejbCreate().
>
> I don't know if there might be some other error somewhere, but this cind
> of behaviour does not seem to be spec compliant. We basically get this:
>
>
>       * Bean instance does not exists
>               |
>               |
>          -newInstance().
>            -setSessionContext()
>            -ejbCreate
>               |
>       * Pool of ready instances --> onMethod() ---|
>                           ^                       |
>                           `------- ejbCreate() <-´
>
>
> It does not seems like correct behaviour that ejbCreate is called when
> the instance is returned to the pool.
>
> Or is it something I have missunderstood?
>
> //Peter
> --
> Jobba hos oss: http://www.tim.se/weblab
> ------------------------------------------------------------
> Peter Antman           Technology in Media, Box 34105 100 26 Stockholm
> Systems Architect      WWW: http://www.tim.se
> Email: [EMAIL PROTECTED]      WWW: http://www.backsource.org
> Phone: +46-(0)8-506 381 11 Mobile: 070-675 3942
> ------------------------------------------------------------
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
>



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

Reply via email to