geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: The need for pooling beans
Date Mon, 02 Nov 2009 16:57:07 GMT

On Nov 2, 2009, at 1:47 AM, Antonio ForniƩ wrote:

> Hello!
> I'd like to know about the real need for pooling SLSB. I think a  
> SLSB is
> meant to have not shared data (not instance variables or so), it  
> only has
> methods that can be invoked from several clients at a time, right?

This is wrong.  Each client gets a separate copy of the SLSB so that  
indeed they can have instance variables and separate requests don't  
interfere with each other.  I won't try to comment on how useful  
instance variables are in an object called exactly once, but that is  
the design.

> Whay
> can't my clients shared the same object? If there's no problem in  
> more than
> one thread using the same method of the same object (SLSB) at the  
> same time,
> why to have some SLSBs pooled instead of a singleton?

IIUC ejb 3.1 includes singleton ejbs.  I don't know much about them.

david jencks

> I find it's necessary in cases where the SLSB has for example a DB
> connection as an instance variable, that should not be used by more  
> than one
> thread at the same time, but it's only for those kinds of cases?
> Thank you very much!
> Antonio
> -- 
> View this message in context:
> Sent from the Apache Geronimo - Users mailing list archive at  

View raw message