Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Cascade=“all-delete-orphan” collection no longer referenced
PostPosted: Tue Oct 24, 2017 2:06 am 
Newbie

Joined: Tue Oct 24, 2017 2:00 am
Posts: 1
Hello,

I am trying to update/get a collection with around seven thousand entries. but hibernate is failing to update/get the entries from collection after around 1000 entries. We are getting the following exception.'

org.springframework.orm.hibernate3.HibernateSystemException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: com.cwsi.workorder.model.WOrder.charges; nested exception is org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: com.cwsi.workorder.model.WOrder.charges

Hope to find a help.

Thanks in advance


Top
 Profile  
 
 Post subject: Re: Hibernate:A collection with cascade=“all-delete-orphan”
PostPosted: Tue Oct 24, 2017 7:59 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1515
1. A collection of 7000 entries means that you are doing it all wrong. If the collection is larger than 10-20 entries, you are better off mapping the @ManyToOne side and use JPQL query to fetch the child entities using pagination.

2. Hibernate 3 is no longer supported, so, even if there is an issue, it will not be fixed. Try to upgrade and see if it replicates.

3. The exception you get is not related to the collection size. I assume you overwrite it instead of adding/updating/removing entries from the managed collection.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.