Re: [hibernate-dev] Static meta-model and references to SessionFactoryImpl

2011-07-20 Thread Gunnar Morling
Hi, to answer my own question: The meta-model is re-created whenever EntityManagerFactoryImpl is instantiated. Hence old meta-model elements will be GC'ed and with them the SessionFactoryImpl etc. (if it was closed). In my case now there was a static reference from application code to one element

[hibernate-dev] Static meta-model and references to SessionFactoryImpl

2011-07-19 Thread Gunnar Morling
Hi, while analyzing a memory leak I noticed that instances of the static JPA 2 meta model seem to hold references to Hibernate's session factory. In my case the path to the factory is the following: SingularAttributeImpl#attributeType -> EmbeddableTypeImpl#hibernateType -> ComponentType#typeScope