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 am trying to retrieve values from the database . I am getting the below stacktrace :
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.singpost.ctf.core.persistence.CtfTxn.ctfTxnAttribs, no session or session was closed
By default the Fetch="LAZY"
, the code is working fine when I changed the Fetch type to EAGER
, I don't know what I have to do further. I am stuck in the middle .