• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Connection Pooling in stateful EJB beans

 
Ranch Hand
Posts: 70
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On one of the site i read that stateful session beans are not usually pooled. i doubt this staement.My question here if stateful beans are not pooled there wont be any need for ejb activate and passivate.(because passivate is called when client request some bean and its already engaged.Then it will passivate it Least used bean. Then it means statefulbeans must be using pool concept).Is the above understanding correct stateful bean can also use pooling?

if it uses pool, when client calls remove it must be cleaning its old state Right?
 
Ranch Hand
Posts: 110
Google Web Toolkit Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Scott,

So far as I know, stateful session beans are not pooled. Pooling is a technique adopted to solve the serial synchronization issue, in other words, to avoid the problem with multiple access to the same bean which creates synchronization problems and also the serial access which in case of synchronizing the whole bean could make serial requests wait too much.

So, once stateful session beans are guaranteed to be unique by client, they're not usually pooled.

if it uses pool, when client calls remove it must be cleaning its old state Right?



I don't think so, even the implementation being specific by vendor therefore susceptible to any implementaion, the computacional price to clean the state of a bean is much higher and could even though not work properly. Even with stateless session beans the state isn't cleaned across multiple requests.

Conclusion, there is no such thing as pooling for stateful session beans, they're created exclusively for a given client and once the remove method is called they're ready to be collected by the GC.

Hope this helps!
 
scott miles
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If stateful session beans are not pooled, then when ejbpassivate and ejbactivate methods are used?

As per my understanding ,when SFSB are pooled and all SFSB are engaged in servicing then say some request comes. Then container tries to passivate the LRU SFSB anf make it available for new request. But i think it is required in case of pooling only.
If SFSB are not pooled is there any need of passivate/activate methods?
 
It's just a flesh wound! Or a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic