users@glassfish.java.net

How to clear EntityManager when transaction commits?

From: <glassfish_at_javadesktop.org>
Date: Thu, 31 Jul 2008 06:01:48 PDT

Hi,

I have a basic question concerning EntityManager and it's clear() method. I'm not sure if this method is called automatically when (container managed) transaction commits. I think it should be, cause without it entities persisted in the transaction can't be garbage collected (assuming that 2nd level cache is disabled). Or maybe in other words - when can entities persisted in a transaction be detached from persistence context and garbage collected - still assuming that 2nd level cache is disabled.

Thanks,
Olaf Tomczak
[Message sent by forum member 'olafos' (olafos)]

http://forums.java.net/jive/thread.jspa?messageID=290634