openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevan Miller <>
Subject Re: svn commit: r561970 - in /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa: enhance/ util/
Date Thu, 02 Aug 2007 01:33:48 GMT

On Aug 1, 2007, at 8:08 PM, Marina Vatkina wrote:

> Kevin,
> Can you please shed more light? What do you call "embedding"  
> OpenJPA? Is running an ear with a PU in it constitutes the embedding?
> If yes, is it not enough to call emf.close() for those emf's that  
> are created by the container?
> How about an emf created by the application via  
> Persistence.createEMF()?

I use the term "embedding" to describe when a component (that can  
potentially run in a stand-alone mode) is included within an  
alternate runtime environment. So, in this case Geronimo "embeds"  
OpenJPA as the JPA implementation within a Geronimo Java EE 5  
application server.

I spent some time trying to allow memory referenced by the PCRegistry  
_metas table to be garbage collected automatically (via weak  
references/hashmaps). However, I don't think it can be done using the  
current implementation of PersistenceCapable objects. Unless that  
changes, some explicit trigger is needed in PCRegistry to allow  
garbage collection to occur (e.g. a deregister() method). This  
trigger can be invoked from within OpenJPA or without. I don't know  
OpenJPA well enough to offer internal solutions. So, I provided a  
solution that I knew I could make work :-) Worst case, it triggers a  
better solution...


View raw message