-->
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.  [ 1 post ] 
Author Message
 Post subject: New object created from critieria parameters
PostPosted: Sun Apr 17, 2011 5:03 pm 
Newbie

Joined: Sun Apr 17, 2011 4:56 pm
Posts: 2
Hi

I'm getting some strange errors in my app. It started as a StaleObjectStateException and after some analysis I think I know a bit more of why this happens.

At one point in my logic I use a criteria query to find Balance objects. In my app, Balance objects are connected to Account objects. One of the Restrictions of the criteria query specifically points to one specific Account object that the Balance should be connected to. When the criteria query is run, it seems that it creates another Account object with the same data as the one used in as a parameter in the Restriction. This other object is connected to the Balance object. Because of this, there are two objects around representing the same thing and this leads to problems...

So, Is there any way I can set up my Hibernate environment so that it is actually the object passed as a parameter that is connected to the returned Balance object and not a newly created one?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.