Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF , Business Delegate , Service locator, stateful session bean

 
katty Leung
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am using a SessionScoped backing bean (for my shopping cart). it has jndi lookup for the stateful session bean interface. the interface stored as a property of that backing bean and will be reused for the subsequent calls to the stateful session bean.

after reading the posts from the forum, I find there's something missing in my design. both business delegate and service locator.
It puts me into confusion when I try to add this 2 design patterns into my existing design.

if service locator cache the stateful session bean's interface. multiple clients access the same service locator also the same stateful session bean interface and share the same shopping cart. that doesn't look right. I am thinking in this situation, for stateful bean, we shouldn't use service locator at all? or I am wrong with the concept? can anyone advice me on that?







 
Nasser Fayeghi Fard
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
katty Leung wrote:
if service locator cache the stateful session bean's interface. multiple clients access the same service locator also the same stateful session bean interface and share the same shopping cart. that doesn't look right. I am thinking in this situation, for stateful bean, we shouldn't use service locator at all? or I am wrong with the concept? can anyone advice me on that?

Katty,
I think you must store your stateful session bean in HttpSession object to prevent illegal access and IMHO, that session bean cannot be cached in that way.

Regards
Nasser Fayeghi Fard
 
katty Leung
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nasser ,

thank you for the answer

-katty
 
Nasser Fayeghi Fard
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are most welcome Katty
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic