Saturday, 7 September 2013

session.disconnect() vs Open Session In View(OSIV) which is better?

session.disconnect() vs Open Session In View(OSIV) which is better?

As per the "Hibernate in action" the best solution of lazy initialization
exception is that to use a centralized code from where we can get the
session or instead of doing session.close() use session.disconnect() so
that the session will be open for lazy loading while connection can be
established and released by using session.disconnect() and
session.reconnect().
I just want to know that is it really the best way to solve lazy
initialization or any performance issue if use this technique instead of
Open Session In View(OSIV).

No comments:

Post a Comment