-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to unload CGLIB enhanced domain classes ?
PostPosted: Thu Feb 15, 2007 8:54 am 
Newbie

Joined: Mon Jul 26, 2004 2:19 pm
Posts: 6
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.3

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
ERROR 2007-02-15 13:39:37,593 BasicLazyInitializer [main]: - CGLIB Enhancement failed: com.etc.ourClass

net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:126)
at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41)
at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:161)
at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:131)
at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Dear Hibernaters,

our current web applications creates MS-Acccess DBs on the fly where data from Oracle is replicated into. In our case, each new MS-Access DB requires its own SessionFactory which is properly closed and released after successful export of the MS-Access file to the user.

Since configuring the SessionFactory on-the-fly generates CGLIB enhanced classes our VMs permanent generation space grows gradually with each export, and inevitabilly causes the VM to quit with an OutOfMemoryError: PermGen space.

We were hoping these classes to be unloaded again after closing and releasing the SessionFactory. Unfortunately, that does not seem to be the case here.

Is there any proposed solution to this phenomenon ?
Any hints and advises are welcome ?

Thanx in advance.

dokmatik


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 11:13 am 
Newbie

Joined: Mon Jul 26, 2004 2:19 pm
Posts: 6
Hi again,

after better queries through this forum I have found excellent links and solutions to our current leak problem.

This sort of "unintentional object/class retention" has already been discussed in detail.
http://forum.hibernate.org/viewtopic.php?t=966401

A solution to this problem is also available:

http://opensource.atlassian.com/projects/hibernate/browse/HHH-2185

I just love this forum.

Regards

dokmatik

CAN I RATE MYSELF ?????


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.