| 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
|
 |
 |
|
|
subject: Hibernate and stateless session beans
|
|
|