This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to store state in statefull session bean  RSS feed

 
gourav chouhan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I have a stateful session bean
but when a client calling method deposit, the value of balance is initializing by 0 every time a client makes a request
that is it is not storing the state so what do i do ?
please help me
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateful session bean will maintain the conversational state as long as the remote reference to it OR its state is stored using EJB Handle.

1. Keep a reference to the stateful session bean between requests in HTTP Session.

2. Serialize the handle to the bean, and then pass this serialized handle to the client in a cookie or persist it in the database. You can also store the handle in session using a key and pass the key as a cookie.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!