-->
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: Delete Cascade problem with version
PostPosted: Sat May 14, 2005 12:40 pm 
Newbie

Joined: Fri Mar 11, 2005 9:08 am
Posts: 4
Hibernate version: 3.0.2


Mapping documents:
Parnet mapping:

<hibernate-mapping >
<class name="parnet" table="parnet" dynamic-insert="true" dynamic-update="true">
<composite-id name="ID" class="ID" >
<key-property name="id" column="ID" type="integer"/>
<key-property name="stringId" column="stringId" />
</composite-id>

<timestamp name="timestamp" column="timestamp" unsaved-value="null"/>

<set name="childs" inverse="true" lazy="false" cascade="all-delete-orphan" fetch="join" >
<key >
<column name="FKID" />
<column name="FKSTringID"/>
</key>
<one-to-many class="Child" />
</set>
</class>
</hibernate-mapping >

Child mapping:
<hibernate-mapping>
<class name="Child" table="Child" dynamic-insert="true" dynamic-update="true">
<composite-id name="key" class="childKey" >
<key-many-to-one name="parnet" class="parnet" >
<column name="FKID"/>
<column name="FKStringId"/>
</key-many-to-one>
<key-many-to-one name="C" column="FKC" class="C"/>
</composite-id>

<timestamp name="timestamp" column="TIMESTAMP" unsaved-value="null"/>

<property name="Date" column="Date"/>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
delete(parnet);

Full stack trace of any exception that occurs:
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): Parnet#Id

Name and version of the database you are using: DB2 8

The generated SQL (show_sql=true):
update parnet set timestamp ..
delete child
delete parnet

the last delete fail ...
can any one know the reason ?
Debug level Hibernate log excerpt:


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.