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

Doubt in Stateful Session Beans

 
Sai Surya
Ranch Hand
Posts: 463
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am implementing a stateful session bean for my shopping cart application. My requirement is to persist the data across many sessions. I mean, for each user login, the user should be able to see other user's cart items. Is it possible with stateful session beans? Or do I need to implement this without stateful session beans? Which approach is faster?

Thanks in advance,
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would a user want to see other user's cart items ? Your implementation depends on the requirement. If you would like any customer to lookup any other cart item, then an entity bean might work well with CMP for a user cart table. You could use finder methods to get the cart items you want based on a customer ID
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic