• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pooling in java or EJB ?

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
we have pooling concept in stateless EJB. What is the advantage of using pooling? My understanding is that it will just save the time in object creation. Is this right?If yes is there a significant difference in performance in creating the object or getting it from the existing pool? Does the pooling serve any other purpose than this?
 
Ranch Hand
Posts: 100
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi scott,

Except for saving the time in object creation that you have already mentioned, I do not think there is any other reason for the pooling of stateless beans maintained by the container. And there definitely would be lot of performance difference between creating a new SLSB every time and getting one from the pool.
For a plain java object, there might not be a lot of difference.
However, we need to note that statless beans are a lot different from plain objects. Each SLSB object should have all its dependencies(resources, other beans etc.) injected at its creation time. Also, there would lot of declarative information(transaction specific, authentication details etc.) that should be parsed for that bean and be known to the container during the object creation. I believe all these should make a bean object creation very expensive and hence the JEE has introduced the concept of pooling for stateless beans.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic