I am using jQuery for UI, Struts2 as Action, JPA for Data Access Layer.
The issue I am facing is that I am getting LazyInitializationException
when I try to retrieve values from the database. I get the stacktrace below:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.singpost.ctf.core.persistence.CtfTxn.ctfTxnAttribs, no session or session was closed
When by default Fetch="LAZY"
, the code is working fine. But when I change the Fetch
type to EAGER
, I don't know what I have to do further. I am stuck in the middle.