Sometimes a LazyInitializationException will be thrown on getHibernateTemplate().load().
Reason being when using load(), Hibernate simply retrieves you a Proxy, which has only the id set, rest of the fields being queried from database when needed. At that time, the hibernate session might have been closed.
A quick fix: replace .load() with .get(). It'll fetch the result immediately.
Reason being when using load(), Hibernate simply retrieves you a Proxy, which has only the id set, rest of the fields being queried from database when needed. At that time, the hibernate session might have been closed.
A quick fix: replace .load() with .get(). It'll fetch the result immediately.