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.  [ 7 posts ] 
Author Message
 Post subject: cglib property changed to bytecode
PostPosted: Sun Dec 10, 2006 4:50 pm 
Newbie

Joined: Fri Dec 08, 2006 3:30 pm
Posts: 7
Hi,

I am new to hibernate. We upgraded hibernate to 3.2 recently. Since one of the property name has changed in 3.2 we changed the following line in our hibernate.cfg.xml files as follows:

<property name="hibernate.cglib.use_reflection_optimizer">false</property>

to

<property name="hibernate.bytecode.use_reflection_optimizer">false</property>

However, in the logs we still see:

Environment.java INFO Bytecode provider name : cglib

Does this look like a problem?
Any help will be highly appreciated.
Thanks.


Hibernate version:
3.2

Debug level Hibernate log excerpt:
2006-12-10 08:55:19,476 [Thread-40] 500 Environment.java INFO Hibernate 3.2.0
2006-12-10 08:55:19,567 [Thread-40] 533 Environment.java INFO hibernate.properties not found
2006-12-10 08:55:19,597 [Thread-40] 667 Environment.java INFO Bytecode provider name : cglib
2006-12-10 08:55:19,648 [Thread-40] 584 Environment.java INFO using JDK 1.4 java.sql.Timestamp handling
2006-12-10 08:55:19,752 [Thread-40] 1350 Configuration.java INFO configuring from resource: SDAS.hibernate.cfg.xml
2006-12-10 08:55:19,753 [Thread-40] 1327 Configuration.java INFO Configuration resource: SDAS.hibernate.cfg.xml


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 10, 2006 5:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no, not a problem.

the property is just to enable/disable a reflection optimization that is mostly relevant for older JDK's.

With or without it we still need to use bytecode library and the default one is cglib.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 10, 2006 5:24 pm 
Newbie

Joined: Fri Dec 08, 2006 3:30 pm
Posts: 7
Max,

Thanks for the help. When you say "need to use bytecode" library - how do I define that to the sytem? I just changed this in the hibernate.cfg.xml file.

Do I also need to do define a JVM properties?

Here's my main issue (it will be a big help if I can get some guidance since I am new to hibernate).

In our system, we upgraded hibernate to version 3.2 - now, I'm told the problem is that we cannot write data to the database anymore in our test environment.

During testing, we did two things that made the problem go away:

1. remove the 'new' hibernate3.jar and replace it with the 'old' hibernate3.jar

2. in the hibernate.cfg.xml file - change bytecode to cglib.

With this, the problem went away.

Any suggestions from your experience what may be causing this? When I did the upgrade was I supposed to change some other files also to reflect the property change?

Once again, thanks for your time and support with this.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 10, 2006 5:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
"I'm told the problem is that we cannot write data to the database anymore in our test environment."

what does that mean ?

regarding upgrades always read the migration guide on hibernate.org (use search to find it)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 10, 2006 5:30 pm 
Newbie

Joined: Fri Dec 08, 2006 3:30 pm
Posts: 7
I meant, the data does not 'persist' in the database.

My best guess is that since just changing one jar and one property name solves the problem - there is something that we are missing in our upgrade. May be there is a file that I don't know of.

I will look for the migration guide.

Thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 10, 2006 5:32 pm 
Newbie

Joined: Fri Dec 08, 2006 3:30 pm
Posts: 7
Max,

Could this be a possible clue:

DTD
Update the DTD reference in your hbm XML files. Change http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd

to
http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in the DOCTYPE.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 10, 2006 5:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes, the dtd should definitly be updated to reflect what you are actually using.

but that said hibernate should not just silently "not save"; it should throw an exception if something goes wrong.

_________________
Max
Don't forget to rate


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