*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes JSF , Business Delegate , Service locator, stateful session bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "JSF , Business Delegate , Service locator, stateful session bean" Watch "JSF , Business Delegate , Service locator, stateful session bean" New topic
Author

JSF , Business Delegate , Service locator, stateful session bean

katty Leung
Greenhorn

Joined: Jun 04, 2010
Posts: 4
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

Joined: Sep 16, 2009
Posts: 20
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


SCJP 6.0 (80%), SCWCD (88%)
Now preparing for SCEA-1
katty Leung
Greenhorn

Joined: Jun 04, 2010
Posts: 4
Hi Nasser ,

thank you for the answer

-katty
Nasser Fayeghi Fard
Greenhorn

Joined: Sep 16, 2009
Posts: 20
You are most welcome Katty
 
jQuery in Action, 2nd edition
 
subject: JSF , Business Delegate , Service locator, stateful session bean
 
Similar Threads
Business Delegate in JEE5
Local Interfaces and SFSBs
Caching SLSB handle
Stateful Session Bean
using session facade vs business delegate