Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getHandle() method  RSS feed

 
P Pradeep Parasuraman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getHandle() method is used to get the information about a bean object. Can anyone tell me how exactly it works.

I read that this method can use to get bean info in certain cases, like, for example, when a user adds a list of items to a cart in a online shopping website and during this process he/she might have to shift to another computer or may be power goes off. Now i can get the list that i have stored on to my cart.

Now my question is "I am able to retrieve information that i have stored in the previous session with the help of getHandle() method. How is that possible if stateful session beans can store client specific info only for that particular session?".

Can anyone help me on this.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Stateful Session Bean (SFSB) stores information about a conversational state with the EJB Server. There is nothing that ties a particular SFSB instance to a particular client in the EJB Spec. It is all about how you use it...

In a typical web application the SFSB's handle (retrieved via getHandle()) would be stored in the User's HttpSession... therefore tying that particular user to the aforementioned SFSB instance. In a thick client, such as a Swing Webstart application, you would manage the SFSB instances in a more straight-forward manner without the need for EJB handles since the request-response disconnect of HTTP is not an issue.

Let me point out one more item, the use of SFSBs is discouraged except in very rare conditions. Think long and hard before you introduce this type of complexity into your applications...
[ March 29, 2006: Message edited by: Chris Mathews ]
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chris,
Nice to see you in JR afer a long time.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Pradip (change of spelling?) I am trying to get back on the horse so to speak.
 
P Pradeep Parasuraman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Chris
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!