-->
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.  [ 4 posts ] 
Author Message
 Post subject: HELP!Cascade removes child relations after a CGLIB exception
PostPosted: Fri Mar 17, 2006 3:16 pm 
Newbie

Joined: Sat Jul 30, 2005 5:18 am
Posts: 6
Hi All,

There was a null value for a double field and it threw "exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of ..." and this was fine because this field should not be null.
BUT it updates and removes all the relationships from the child objects right after throwing the exception.
Anybody knows how can I avoid this?

Thanks.


Top
 Profile  
 
 Post subject: object
PostPosted: Fri Mar 17, 2006 4:26 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
use object Double, not the primitive double as property type.
Or make sure that there are no nulls in the double column in the database, add not null constraint to the column.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: Re: object
PostPosted: Sat Mar 18, 2006 3:33 pm 
Newbie

Joined: Sat Jul 30, 2005 5:18 am
Posts: 6
[quote="kgignatyev"]use object Double, not the primitive double as property type.
Or make sure that there are no nulls in the double column in the database, add not null constraint to the column.[/quote]

Thanks for the suggestions. As I said I know the field should not be null. That can fixable with the not null constraint as you said but are you saying that Hibernate's behavior is acceptable in this scenerio. I don't think so.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 2:39 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I guess that the exception that you have seen was thrown when you were trying to read object from database but there was null in the field. If there was a value then it was converted to the primitive just fine.

Please post your code and explain where exactly Hibernate behaves unexpectedly

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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