Discussions

EJB design: Hibernate+stateless session bean

  1. Hibernate+stateless session bean (2 messages)

    Is it good design or architect to access hiberante through stateless session bean compare to access hiberante directly.
  2. Re: Hibernate+stateless session bean[ Go to top ]

    It would be preferable if you have your stateful session beans mediate access to the hibernate session.Normally, hibernate should be called from either servlets or session beans. cheers, http://www.javaicillusion.blogspot.com/
  3. Re: Hibernate+stateless session bean[ Go to top ]

    It would be preferable if you have your stateful session beans mediate access to the hibernate session.Normally, hibernate should be called from either servlets or session beans
    I don't think that's totally correct. The answer lies in the fact wheather you want the hibernate session to be stored across calls (which is less advised). If that's not the case, then its best done from the stateless session bean, as the overheads are minimal. Remember, in hibernate, creating session is very cheap, creating a session factory is the one which is expensive. Infact, its most suggested that you recreate hibernate sessions instead of trying and storing them for a prolonged duration (typically across calls). Regards, Rakesh.