JBoss Community

Re: EJB3 Session Bean Pool

created by Robert Geisler in EJB3 - View the full discussion

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