-->
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: NonUniqueObjectrValue exception while deleting
PostPosted: Mon Apr 03, 2006 10:06 am 
Newbie

Joined: Sat Feb 25, 2006 8:19 am
Posts: 7
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5

Mapping documents:

Code between sessionFactory.openSession() and session.close():
private void removeList(List list) {
Session session = sessionFactory.openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
if (list == null) {
return;
}
Iterator iter = list.iterator();
while (iter.hasNext()) {
session.delete(iter.next());
iter.remove();
}
tx.commit();
} catch (RuntimeException ex) {
if (tx != null) {
tx.rollback();
}
throw ex;
} finally {
session.close();
}
}


Full stack trace of any exception that occurs:

Name and version of the database you are using: oracle 10g

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I have a list of sites, each with many other associations to other hibernate objects. I don't have any cascades at the database level (NO foreign keys with "ON DELETE CASCADE"), and I do have "all-delete-orphan" at many associations (not all, but most), because the site is one of the central objects in my model. I want to clear the database at this test I am running, right before filling it up again with random new data. When I try to run the previous method my site list, I get the above-mentioned NonUniqueObjectValue exception. I thought that maybe some cascading option I have in the xml was causing the site to somehow delete itself, or delete a following site, but I have no such cascading - no other object in the database has "all-delete-orphan" on the site object. I also changed several of the site's cascading associations to just "save-update", but I Still haven't found which association causes this trouble.
Where can I look for a solution for this problem? What might have caused it?

Thank you.


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.