-->
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: Reassociated object has dirty collection
PostPosted: Sat Sep 28, 2013 9:28 pm 
Newbie

Joined: Sat Sep 28, 2013 9:12 pm
Posts: 3
Hello everyone !

I have a problem with my small game application using Hibernate when I try to save an entity which have a modified collection of others entities in it.

The program throws this exception : "Reassociated object has dirty collection" at this line :
https://github.com/debnet/ircrpg/blob/master/src/fr/debnet/ircrpg/DAO.java#L163
Nevertheless, the data seems to be successfully updated in the database !

I well understand the meaning of this message but since weeks I can't find something to help me.
I reached the 10th result page in Google, I directly ask my question on Freenode, search all over Hibernate forums... there is something here I don't understand.

Here my use case :
https://github.com/debnet/ircrpg/blob/master/src/fr/debnet/ircrpg/game/Game.java#L1338-1361
  • A player wants to buy an item
  • After several checks, the stock of entity instance "Item" is decreased
  • The item is saved in order to persist the new stock value
  • The item is added in the "items" collection of the entity instance "Player"
  • The player is saved in order to persist the new object in his inventory
  • Exception on save (or on lock) but data correctly updated

For my purpose, I created an custom DAO in order to hide the Hibernate process in my application.
I'm pretty sure there is something wrong about my comprehension of the internal mechanisms.

Please help me. ;)
PS: Sorry for my english, I clearly had a lack of practice...


Top
 Profile  
 
 Post subject: Re: Reassociated object has dirty collection
PostPosted: Fri Oct 04, 2013 1:14 pm 
Newbie

Joined: Sat Sep 28, 2013 9:12 pm
Posts: 3
No one for my problem? :(


Top
 Profile  
 
 Post subject: Re: Reassociated object has dirty collection
PostPosted: Fri Nov 01, 2013 11:59 pm 
Newbie

Joined: Sat Sep 28, 2013 9:12 pm
Posts: 3
I'm still seeking about a solution... Anyone can help me please?


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.