permaculture playing cards*
The moose likes Object Relational Mapping and the fly likes Hibernate and stateless session beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate and stateless session beans" Watch "Hibernate and stateless session beans" New topic
Author

Hibernate and stateless session beans

Parag Doshi
Ranch Hand

Joined: Jun 29, 2004
Posts: 317
Hi,
How can I use hibernate to work with session beans, where one stateless session bean invokes a method of another stateless session bean? Is the Hibernate Session started in the first session bean extended to the second session bean?
What are the strategies and/or limitations of using hibernate with session beans in general?

Thanks,
Parag
Parag Doshi
Ranch Hand

Joined: Jun 29, 2004
Posts: 317
It seems odd, but, doesn't anyone know about using hibernate and session beans in general?

Parag
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


It seems odd, but, doesn't anyone know about using hibernate and session beans in general?

Well, the Hibernate documentation does. A session is:

an inexpensive, non-threadsafe object that should be used once, for a single business process, and then discarded.


Think about how session stateless beans work and how you could get access to a session created in one from another. Passing the session about between EJB methods would crucify performance - since the session is also the first level cache and if the beans are remote the container would have to serialize the entire first level cache to call another method.

The documentation actually says if you are using a session with session beans each business method should open, close and flush a session.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate and stateless session beans
 
Similar Threads
EJB Bean Pooling
Stateful session beans or Stateless combined with entity beans
JSP
Bean life cycle cheat sheet
MultiThreaded Bean