Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Question on EclipseLink 2.0 and J2SE

If you call close() on the EntityManagerFactory, this should release its
resources.  If you create more than one factory, you must close all of them
before the persistence unit is undeployed.

You also need to ensure your application is no longer holding onto the
factory or any EntityManager or any of the objects read before everything
gets garbage collected.

What "stuff"you seeing being left?  Can you use a memory profiler such as
JProfiler to determine what is holding onto the objects?

Also turn logging to finest and verify the "undeploy" is being logged.


chadawilson wrote:
> 
> I'm running a small application that needs to query a database for a
> single JPA POJO.  What I had expected was after getting said POJO, closing
> the EntityManager (and I even went so far as to clear the cache, and close
> the entitymanagerfactory), then setting the entitymanager and pojo
> references to null, that the persistence unit loaded classes, as well as
> the myriad of "stuff" that Eclipselink loads into heap would be garbage
> collected.  This is not occurring.
> 
> Is this a bug?  If not how can I acheive garbage collection on the loaded
> stuff?
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Question-on-EclipseLink-2.0-and-J2SE-tp27231706p27324041.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top