-->
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: deleting cause ORA-02292: integrity constraint violated - ch
PostPosted: Tue Jun 28, 2005 5:43 pm 
Beginner
Beginner

Joined: Tue Jun 22, 2004 3:16 pm
Posts: 35
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2.1.2

I am having this ORA-02292: integrity constraint (PROVIDER.SYS_C0016817) violated - child record found error when I delete record in database using delete() method. I have two tables map to two classes: PublicationEmail (P1) and PublicationEmailNetworksType (P2). P1 have a set of P2. Here are the mapping:

P1:
<class name="PublicationEmail" table="TBL_PUB_EMAIL" dynamic-update="true">
<id column="PK_PUB_EMAIL_ID" name="id" type="integer">
<generator class="sequence">
<param name="sequence">SEQ_PUB_EMAIL_ID</param>
</generator>
</id>

<property column="SUBJECT" name="subject" type="string" />
<set inverse="true" name="pubEmailNetworksTypes" cascade="all">
<key column="FK_PUB_EMAIL_ID" />
<one-to-many class="com.model.PublicationEmailNetworksType" />
</set>
</class>

P2:
<class name="PublicationEmailNetworksType" table="TBL_PUB_EMAIL_NETTYPE">
<id column="PK_PUB_EMAIL_NETTYPE_ID" name="id" type="integer">
<generator class="sequence">
<param name="sequence">SEQ_PUB_EMAIL_NETTYPE_ID</param>
</generator>
</id>

<many-to-one class="com.model.PublicationEmail" name="pubEmail"
cascade="save-update">
<column name="FK_PUB_EMAIL_ID" />
</many-to-one>

<property column="FK_PROVIDER_NETWORKS_TYPE" name="networksType" type="com.model.customtypes.ProviderNetworksTypeUserType"/>
</class>

When I call dao.delete(pubEmail), sometimes it works fine, but sometimes it failed:

Caused by: java.sql.SQLException: ORA-02091: transaction rolled back
ORA-02292: integrity constraint (PROVIDER.SYS_C0016817) violated - child record found

What is wrong? I am using ral old version of Hibernate (2.1.2), is that a problem? I see 3.0 has this:
support cascade delete via ON DELETE CASCADE constraint

Does that matter?

Thanks,

J


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.