I have been struggling with this for a whlle. I have the following HQL:
and it seems to work OK (I think). When I try and access the prosocPermissions objects using:Code:SELECT prosocUser FROM ProsocUser AS prosocUser LEFT JOIN FETCH prosocUser.prosocPermissions WHERE prosocUser.userId = :userId
I get the error:Code:prosocUser.getProsocPermissions();
I know this is being thrown because the hibernate session has been closed but I can't figure out the solution to it. I am using:Code:org.hibernate.LazyInitializationException: could not initialize proxy - no Session
and I think that means that the session is closed before processing gets to the view stage which is where I am trying to access the hibernate proxy object. I have however tried to use:Code:sessionFactory.getCurrentSession()
but to no effect.Code:org.hibernate.Hibernate.initialize(prosocUser.getProsocPermissions());
Can anyone help me out?


Reply With Quote