-->
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.  [ 11 posts ] 
Author Message
 Post subject: Specify hibernate.jar for Hibernate console?
PostPosted: Tue Oct 04, 2005 9:48 am 
Newbie

Joined: Wed Dec 10, 2003 3:55 pm
Posts: 9
Location: Atlanta, GA
Is there a way to specify which hibernate.jar file to use in the Hibernate console?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 12:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
What is your usecaes for specifying a different jar ?

The tools are being built against Hibernate 3.1 head so it should be at least 3.1 compliant and then you can just go in and replace the hibernate 3.1 jar at that location - but that is not recommended.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 05, 2005 8:46 am 
Newbie

Joined: Wed Dec 10, 2003 3:55 pm
Posts: 9
Location: Atlanta, GA
Our code is being developed with hibernate 3.0 and the console is complaining about errors in the hbm.xml files.

I replaced C:\eclipse\configuration\org.eclipse.osgi\bundles\130\1\.cp\lib\hibernate\hibernate3.jar with the 3.0 hibernate.jar. And it seems to have fixed my problem.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 05, 2005 10:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
please show those errors....3.1 should be backwards compatible...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 05, 2005 4:57 pm 
Newbie

Joined: Wed Dec 10, 2003 3:55 pm
Posts: 9
Location: Atlanta, GA
It complains about lazy="true"
Quote:
<many-to-one name="lnkLoan" column="LOAN_ID" lazy="true" class="Loan" />


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 4:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
lazy="true" is evil. Are you really performing build time enhancement to activate it ?

It is/was broken in H3.0 and thus lazy="proxy" or "false" should be used in all cases.

We replaced it with "no-proxy" in 3.1 which actually works correctly compared to lazy="true" in H3

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 6:37 am 
Newbie

Joined: Wed Dec 10, 2003 3:55 pm
Posts: 9
Location: Atlanta, GA
I'm dictated the mapping files from other developers, so there's not much I can do to change them. But, I can perhaps persuade them to modify them if I can show them why it needs to be changed. Is there somewhere I can refer them to that shows that lazy="true" is broken in 3.0?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 6:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - my posting.

lazy="true" only makes sense when you have buildtime enhanced your code (if not it becoms lazy="false" which you definitly do not want) and it is/first properly handled in H3.1

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 7:14 am 
Newbie

Joined: Wed Dec 10, 2003 3:55 pm
Posts: 9
Location: Atlanta, GA
OK, I'll show them this thread to let them know about it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2009 10:22 am 
Newbie

Joined: Tue Feb 03, 2009 9:26 am
Posts: 3
I recently ran into this problem of migrating an existing project from hibernate 3.0 to hibernate 3.2 and after replacing the hibernate3.jar I got the same error:

Attribute "lazy" with value "true" must have a value from the list "false proxy no-proxy "

When searching the internet for this error message, I got to this forum post that explains all about it.

Ok then, so I had to replace lazy="true" to lazy="no-proxy".

Because there where many mapping files in my project, written by many other developers, obviously I thought the simplest way to do it is "Replace all" from lazy="true" to lazy="no-proxy" in *.hbm.xml.

After redeploying the application, I got an error message saying exactly the opposite:

Attribute "lazy" with value "no-proxy" must have a value from the list "true false "

Ok, now WTF?...
Again, search the internet, now for this new error message... Nothing... no result.
Try to see if by chance I have an older DTD file somewhere in the project, that conflicts with the one shipped with hibernate 3.2... Again no result...
Actually the DTD in hibernate 3.2 seems to be the same as in hibernate 3.0... So where is the problem?

After another half an hour of searching, finally the solution:
I only had to do the "Replace all" for the <one-to-many>, <one-to-one>, and <many-to-one> elements, but NOT for the <class> element...

Of course, this was not pointed out anywhere in the org.hibernate.util.XMLHelper error message...

So if anyone else makes the same mistake, hopefully they can now find this forum post here...


Top
 Profile  
 
 Post subject: Re: Specify hibernate.jar for Hibernate console?
PostPosted: Fri Apr 15, 2011 3:11 am 
Newbie

Joined: Fri Apr 15, 2011 3:02 am
Posts: 1
Hi all,

i'm making an upgrade from Hibernate 3.0 to Hibernate 3.6, this is not very simple.
I encountered the same validation problems...
thanx to all and thanx to sorin_postelnicu for your very usefull post...

If you have some migration guide or advise, from Hib 3.0 to Hib 3.6, please let me know in this post...

Bye, ciao!


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