-->
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.  [ 2 posts ] 
Author Message
 Post subject: StaleStateException when adding (0,1) to many relationship
PostPosted: Wed Apr 11, 2007 2:30 pm 
Newbie

Joined: Wed Oct 04, 2006 2:43 pm
Posts: 16
Location: Lexington, KY
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2.1

Name and version of the database you are using:
Informix 9


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

I have this person table set up. This person table has a (0,1) to many relationship with accounts, although there's never more than one account. This is imported through a set into my person class and all is well.

The problem is that when the person does not have an account, then I set up the account and create the collection, hibernate barfs on the SaveOrUpdate (I'm using Spring 2.0.4).

It appears it is saving the contents of the new collection just fine, but then there is another update with the same table with null keys, which prevents it from updating anything and I get a stalestateexception.

Why is hibernate still trying to persist a collection that no longer exists?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 11:42 pm 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
Hi thehl,

Post your code that would help us to understand and mean while try to debug version field of staleObject with DB That would give you clue to find root cause.

_________________
Dharmendra Pandey


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