-->
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.  [ 3 posts ] 
Author Message
 Post subject: Objects corrupted at runtime with Hibernate 3
PostPosted: Mon May 16, 2005 1:40 pm 
Newbie

Joined: Mon May 16, 2005 1:12 pm
Posts: 4
My app worked correctly with Hibernate 2 but I'm having a serious problem
with Hibernate 3. It's hard to figure out what's wrong since my objects
seem to be corrupted at runtime by Hibernate :

Method toString() being implemented as
Code:
return getAttribute();

obj being the result of a query, the following two statements print different results

Code:
println(obj.toString());     // prints "foo" as expected
println(obj.getAttribute()); // prints null !!!!


The variable obj in two consecutive statements does not reference
the same content.

I've been investigating what could be the context of the error but it is
difficult since I can no longer trust the getters !

It seems that it happens only when I read the 5th row of a table : the
4th object and the 6th object are read correctly from the table but not the 5th

Is there anything to do ?

I'm using MySQL 5.0.4


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 16, 2005 1:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
probably you got a final method

read the docs on proxies


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 16, 2005 2:36 pm 
Newbie

Joined: Mon May 16, 2005 1:12 pm
Posts: 4
I've declared the class with lazy=false and now everything is working fine.
Thanks,


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