"And, is there a better alternative than using
OpenSessionInViewInterceptor?"

Yes. It's important to realise that while OpenSessionInView feels very
handy, it is not a particularly nice design pattern, as it can stress your
database with lots of small queries. It's best to learn how to do eager
fetching with Hibernate and use it for most cases and rely on OSIV only in
some special cases where eager fetching is not possible. This way it's often
possible to build entire web applications without resorting to use OSIV.

Reply via email to