My bad. To turn off cglib you need to set it as a system-level property.
java -Dhibernate.cglib.use_reflection_optimizer=false

http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configuration.html#configuration-misc-properties
hibernate.cglib.use_reflection_optimizer=false
Enables/disables use of CGLIB instead of runtime reflection (System-level
property). Reflection can sometimes be useful when troubleshooting, note
that Hibernate always requires CGLIB even if you turn off the optimizer. You
can not set this property in hibernate.cfg.xml.

On 6/5/07, Jeoff Wilks <[EMAIL PROTECTED]> wrote:


http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch13.html#ch13.config.table
hibernate.cglib.use_reflection_optimizer=false

Set this in hibernate.properties, as a java system property, or by calling
Configuration#setProperty() directly.

You can postpone the problem a bit using the java command flag
-XX:MaxPermSize.
e.g. from http://www.caucho.com/support/resin-interest/0512/0022.html
> Of course we can increase the PermGen size by adding -XX:MaxPermSize to
> the command line. Though this only increases N and pushes the problem
> further away, but it will always occur eventually.

On 6/5/07, John Mitchell < [EMAIL PROTECTED]> wrote:
>
> Jeff,
>
> Thanks for the info!  How do I turn off CGLIB?
>
> Thanks,
>
> John Mitchell
>
> On 6/4/07, Jeoff Wilks < [EMAIL PROTECTED]> wrote:
> >
> > Every time the CGLIB Enhancer generates a new class, that generated
> > class jumps straight to the PermGen (permanent generation) of your java
> > heap. CGLIB Enhancers are faster in terms of performance, but more dangerous
> > in terms of memory consumption. (I ran into this same problem with another
> > product that uses CGLIB.)
> >
> > Try turning off CGLIB and just have hibernate use reflection. If that
> > solves the problem, then you can always work on tuning CGLIB later.
> >
> >
> > On 6/4/07, John Mitchell <[EMAIL PROTECTED]> wrote:
> >
> > >  Hi,
> > >
> > > I have been having to restart Apache Tomcat as frequently as once a
> > > day and I suspect the problem is related to hibernate.
> > >
> > > I have attached an error log from apache tomcat:
> > >
> > > I get the following error below
> > >
> > > ERROR BasicLazyInitializer:105 - CBLIB Enhancement failed:
> > > com.insequence.gv.ProductOrder
> > >
> > > then further down the log file
> > >
> > > java.lang.OutOfMemoryError: PermGen space
> > >
> > > I also noticed towards the beginning of the log file
> > >
> > > 13:26:55,625  INFO DriverManagerConnectionProvider:41 - Using
> > > Hibernate built-in connection pool (not for production use!)
> > > 13:26:55,640  INFO DriverManagerConnectionProvider:42 - Hibernate
> > > connection pool size: 1
> > >
> > > Do I need to switch to a different connection pool and if so what?
> > > Should I change the "Hibernate connection pool size: 1"  to a number
> > > higher than 1 for better stability and if so what number?
> > >
> > > Thanks,
> > >
> > > --
> > > John J. Mitchell
> > >
> > > -------------------------------------------------------------------------
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > _______________________________________________
> > > hibernate-devel mailing list
> > > hibernate-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> > >
> > >
> > >
> >
>
>
> --
> John J. Mitchell



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to