users@glassfish.java.net

Re: org.hibernate.SessionException:Session is closed!

From: Dan Allen (mojavelinux) <"Dan>
Date: Tue, 25 Nov 2008 09:45:09 -0800 (PST)

Exactly, you are closing the EntityManager in the finally block and then the
container fails when it attempts to close it at transaction completion. The
whole idea of a container-managed persistence context is that you don't have
to manage it, so don't ;)


Sahoo wrote:
>
> Why do you have this line of code:
>
> em = DatabaseUtil.getEntityManager();
>
>
> when you have the injected entity manager at your disposal? Use the
> injected EM and let us know.
>

-- 
View this message in context: http://www.nabble.com/org.hibernate.SessionException%3ASession-is-closed%21-tp20682799p20686186.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.