[jboss-user] [EJB3] - Re: EJB3 Session Bean Pool

Robert Geisler do-not-reply at jboss.com
Tue Apr 5 06:47:21 EDT 2011

Robert Geisler [http://community.jboss.org/people/robert.geisler] created the discussion

"Re: EJB3 Session Bean Pool"

To view the discussion, visit: http://community.jboss.org/message/597828#597828

thank you, carlo for response.

of course you are right, one could extend StrictMaxPool and enlarge strictMaxSize semaphore. but what is the benefit of using the semaphore at all? isnt it an unnecessary overhead? we believe we do not need a maximum to limit creation of instances, but we need a maximum of pooled instances!

so i thought about a pool implementation backed by a simple array with length maxSize:
1. get() looks into the array and returns and removes the last element -if available;
2. otherwise create a new one, no maximum for creating instances (aka tolerant)!
3. instances that are released go back into the array -if they fit into it (maxSize = array length);
4. otherwise they are removed immediately.

this seems to be quite simple to implement...?
would you expect any issues with such an implementation?

Reply to this message by going to Community

Start a new discussion in EJB3 at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110405/9373ea4f/attachment-0001.html 

More information about the jboss-user mailing list