-->
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.  [ 12 posts ] 
Author Message
 Post subject: disabling cblib
PostPosted: Mon Mar 14, 2005 6:06 pm 
Newbie

Joined: Tue Jan 18, 2005 10:41 pm
Posts: 15
I am trying to disable CBLIB by adding “hibernate.cglib.use_reflection_optimizer false” to my hibernate properties, but this doesn’t seam to work under hibernate V3.

I have also tried to add it to the system properties, but without success.

The only way I can prevent hibernate from generating CBLIB proxies classes is to add the Lazy=”false” property to each class.

Is this correct?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 15, 2005 3:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
another option is to put default-lazy="false" in the hibernate-mapping element.

The reflection_optimizer is for cglib support for more efficient properties read/write operations....not related to lazy, so you need both to avoid this. (im not sure if i'm forgetting something so try it out ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 15, 2005 5:40 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
max wrote:
another option is to put default-lazy="false" in the hibernate-mapping element.

The reflection_optimizer is for cglib support for more efficient properties read/write operations....not related to lazy, so you need both to avoid this. (im not sure if i'm forgetting something so try it out ,)


Probably it is a good time to drop "reflection_optimizer" (or to dissable it by default), SUN JVM generates code since jdk 1.4.2 to optimize native calls in reflection itself, double code generation just wastes memory (cglib is bit faster, but difference is too trivial to be usefull for data access).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 15, 2005 5:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok - could you put this info in the jra so it wont be lost ?

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 15, 2005 4:48 pm 
Newbie

Joined: Tue Jan 18, 2005 10:41 pm
Posts: 15
Thanks for the replies.

But...

Does the hibernate property "hibernate.cglib.use_reflection_optimizer" work under V3?

IMHO she be broken!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 15, 2005 5:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes it does. and no it is not broken since it does not have anything to do with lazy stuff.

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 15, 2005 5:17 pm 
Newbie

Joined: Tue Jan 18, 2005 10:41 pm
Posts: 15
Sorry.

Docs are not very clear as to what this property affects.


Top
 Profile  
 
 Post subject: Re: disabling cglib
PostPosted: Fri Apr 15, 2005 7:56 pm 
Newbie

Joined: Fri Apr 15, 2005 7:52 pm
Posts: 13
Setting the "hibernate.cglib.use_reflection_optimizer" property to false does not seem to work with hibernate V3 (latest production release), it works with 2.1 though. I think the original poster has a valid issue here. Could the team please check? Thanks!

_________________
Tired of spam? => http://www.spamino.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 16, 2005 1:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that options disables the usage of cglib while performing set and get operations - it has never completely disabled cglib.

cglib is activated when you have lazy/proxy classes which in H3 now is default for every class. If you dont want that then set lazy="false" on your classes.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 7:01 pm 
Newbie

Joined: Fri Apr 15, 2005 7:52 pm
Posts: 13
Thanks, but I think it's not that easy. cglib seems to be activated also through other properties/conditions than just not setting lazy="false" (which prevented calling cglib optimization methods but it sometimes still decides to call some other cglib "BulkBean" methods). It seems to me kind of dangerous and unnecessary to walk the methods through reflection upon startup and I feel that it would be safer to have cglib disabled by default. Depending of the order of the methods and what classes you use inside, cglib easily gets trapped in recursive/looping patterns and will then throw out of memory errors or just stall. Your team mate mentioned that there's plans to abandon the use of cglib, are there any news on that? Thanks

_________________
Tired of spam? => http://www.spamino.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2005 2:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you need to report such claims as bug reports with failing test cases.

cglib is used for proxying and that is enabled by default in H3 and as I told you to not have it do its thing you need to run with lazy="false" and/or default-lazy="false" to not have cglib invoked.

And if someone wants to replace cglib with something what should it be ? It would be something else that needed to proxy all the related classes and there is only a few ways to do that right (and as far as I know cglib does it fine ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2005 11:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
Your team mate mentioned that there's plans to abandon the use of cglib, are there any news on that? Thanks

He was talking about possibly not using cglib for reflection optimization. As Max mentioned, cglib usage will *not* be removed for the lazy/proxy stuff.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.