-
Hibernate+stateless session bean (2 messages)
- Posted by: nuthan kumar an
- Posted on: November 06 2006 13:56 EST
Is it good design or architect to access hiberante through stateless session bean compare to access hiberante directly.Threaded Messages (2)
- Re: Hibernate+stateless session bean by arijit dey on November 07 2006 07:36 EST
- Re: Hibernate+stateless session bean by Rakesh Malpani on November 08 2006 08:53 EST
-
Re: Hibernate+stateless session bean[ Go to top ]
- Posted by: arijit dey
- Posted on: November 07 2006 07:36 EST
- in response to nuthan kumar an
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/ -
Re: Hibernate+stateless session bean[ Go to top ]
- Posted by: Rakesh Malpani
- Posted on: November 08 2006 08:53 EST
- in response to arijit dey
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.