Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SFSB pooling  RSS feed

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I read in some web site that it is possible to have stateful session bean pooling.
How does it work? Any ideas.
Thanks
 
Alan Petersen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since pooling of SFSBs isn't part of the specification, it would depend on the application server. The server, if it were to employ pooling, would have to ensure that the lifecycle of the instances would remain unaltered from the specification.
- alan
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the performance gain from pooling stateful SessionBean instances would be generally negligible. Can you remember the source's reasons for doing it?
 
mathew mathews
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what ALEN said is correct.pooling SFSB isn't part of specification.But some
vendors implement it.As SFSB are not shared, saying that it can be pooled is logically incorrect.
mathews
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they pool then who is going to call Class.newInstance when a client calls create on the home. I feel pooling is not possible in SFSB.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
If they pool then who is going to call Class.newInstance when a client calls create on the home. I feel pooling is not possible in SFSB.

I think that the only way to pool SFSBs is to pool "living" instances of com.foobar.MySessionBean and set the correct internal state using reflection whenever a method invocation comes in for some SFSB identity. Of course that means that Class.newInstance() is not called but then again you're not supposed to do anything in the bean implementation class' constructor.
If this really is the only way to pool SFSBs then I really don't see where the value of it is, though.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!