• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate and stateless session beans

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems odd, but, doesn't anyone know about using hibernate and session beans in general?

Parag
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic