-->
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: delete problem
PostPosted: Mon Aug 02, 2004 2:23 am 
Newbie

Joined: Thu Apr 29, 2004 10:29 am
Posts: 13
I'm trying to delete a parent with childs but can't do it...

I have the cascade="all-delete-orphan"...
the problem is when it try to delete one child it first set the parentID to null.. and then try to delete it... but i get a stale exception (i'm using version timestamp), i know why i'm getting the exception.. i just can't understand why it try to set the parentID to null... just in case.. I CAN'T USE BIDIRECTIONAL RELATIONSHIPS...

(monthlyTransaction is the child and fund is the parent)

Quote:
03:19:20,400 INFO [STDOUT] Hibernate: update monthlyTransaction set fundId=null where fundId=?
03:19:20,403 INFO [STDOUT] Hibernate: delete from monthlyTransaction where id=? and timestamp=?
03:19:20,406 WARN [StaleObjectStateException] An operation failed due to stale data
net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for uy.edu.ort.domain.classes.MonthlyTransaction instance with identifier: 1


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 2:46 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
try with inverse="true" on collection mapping.
If it does not help, post your java classes, their mappings and javacode of child deletion.

--
Leonid


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.