-->
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.  [ 5 posts ] 
Author Message
 Post subject: ConcurrentModificationException
PostPosted: Tue Feb 17, 2004 7:00 am 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
I add objects to a set and then tries to iterate it.

A call to
Quote:
iterator.next();
throws this one:

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$KeyIterator.next(HashMap.java:818)
at net.sf.hibernate.collection.PersistentCollection$IteratorProxy.next(PersistentCollection.java:441)



I'm using 2.1.2 and lazy sets.

Anyone?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 7:22 am 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
I do not use threads, by the way....


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 7:49 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
It can be caused by bug in cache / "disconnected" session, or
by objects stored in httpsession/servletContext.

"ConcurrentModificationException" always means "Concurrent Modification" :)


Top
 Profile  
 
 Post subject: Re: ConcurrentModificationException
PostPosted: Wed Feb 25, 2004 12:33 am 
Newbie

Joined: Wed Feb 25, 2004 12:25 am
Posts: 1
nickvajberg wrote:
I add objects to a set and then tries to iterate it.

A call to
Quote:
iterator.next();
throws this one:

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$KeyIterator.next(HashMap.java:818)
at net.sf.hibernate.collection.PersistentCollection$IteratorProxy.next(PersistentCollection.java:441)



I'm using 2.1.2 and lazy sets.

Anyone?


Did you ever find a fix for this problem? I am getting a similar problem attempting to do deletes. My relationship basically looks like this.

GrandParent -> Parent -> Child.

I have cascade="delete-all-orphan" on each collection and inverse="true".
I also have cascade="none" for the "toParent" relationships.

My stack trace looks like this.

at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
at java.util.AbstractList$Itr.next(AbstractList.java:417)
at net.sf.hibernate.collection.PersistentCollection$IteratorProxy.next(PersistentCollection.java:441)
at net.sf.hibernate.engine.Cascades.cascadeCollection(Cascades.java:526)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:452)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:482)
at net.sf.hibernate.impl.SessionImpl.doDelete(SessionImpl.java:1209)
at net.sf.hibernate.impl.SessionImpl.delete(SessionImpl.java:1146)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 25, 2004 3:45 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
nickvajberg wrote:
I do not use threads, by the way....


you mean?
how do you manage your hibernate Sessions?

At the beginning we considered the session as the application cache, it isn't!!!
Consider hibernate Session as a business unit cache, the cache is EHCache for example.

i this can help you....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.