-->
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.  [ 8 posts ] 
Author Message
 Post subject: Search 3.3 CR2 ConcurrentModificationException
PostPosted: Tue Dec 14, 2010 4:08 am 
Newbie

Joined: Tue Dec 14, 2010 4:06 am
Posts: 4
I get the following error when I try to run a commit on a change to an entry in my database that I had previously created in another transaction.

org.hibernate.HibernateException: Error while indexing in Hibernate Search (before transaction completion)
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:175)
at org.hibernate.engine.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:543)
at org.hibernate.engine.ActionQueue.beforeTransactionCompletion(ActionQueue.java:216)
at org.hibernate.impl.SessionImpl.beforeTransactionCompletion(SessionImpl.java:571)
at org.hibernate.jdbc.JDBCContext.beforeTransactionCompletion(JDBCContext.java:250)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:138)
at my.code tx.commit();

Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$ValueIterator.next(HashMap.java:822)
at org.hibernate.search.engine.WorkPlan.processContainedInAndPrepareExecution(WorkPlan.java:119)
at org.hibernate.search.backend.WorkQueue.prepareWorkPlan(WorkQueue.java:133)
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:124)
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.beforeCompletion(PostTransactionWorkQueueSynchronization.java:89)
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:172)
... 7 more
|#]

I have spent a couple of days trying to track this down, but no luck.

I should also mention that I am using the c3p0 connection pool. If anyone has any ideas, please let me know.


Top
 Profile  
 
 Post subject: Re: Search 3.3 CR2 ConcurrentModificationException
PostPosted: Tue Dec 14, 2010 7:18 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hello,
thanks for reporting this, my fault!
Just on time to save the release.

http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-647

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Search 3.3 CR2 ConcurrentModificationException
PostPosted: Tue Dec 14, 2010 8:56 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
I think the fix is pretty trivial and would like to merge it soon, but I'm having a hard time thinking about a unit test able to reproduce the bug. Could you please share a minimal unit test able to reproduce the error?
This is quite urgent to make sure it's fixed in the 3.3 release, thanks.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Search 3.3 CR2 ConcurrentModificationException
PostPosted: Tue Dec 14, 2010 10:31 am 
Newbie

Joined: Tue Dec 14, 2010 4:06 am
Posts: 4
What I did was to create a new object and save it to the session and commit that transaction. Soon after, I started another transaction, changed a property of the object, and committed the transaction. The error then came on that second commit.

This didn't happen every time. It seems to be some complicated race condition. I never got this error with CR1 or earlier versions of HS.

Hopefully this is enough information for you. I am not at work right now, so this is the best I can do. I am in Japan, so it is already time to go to bed. I will be at work in about 10 hours, though...


Top
 Profile  
 
 Post subject: Re: Search 3.3 CR2 ConcurrentModificationException
PostPosted: Tue Dec 14, 2010 5:12 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi Makoto,
I would need to know how the object you saved was mapped, if you could provide a simplified version of your model (like just two entities with minimal set of properties).
I don't think it's a race condition, the name of the exception was badly chosen, but there should be a combination of model & data able to trigger it consistently.
Anyway, I think I've fixed it, please try the release we'll publish tomorrow; still I'd appreciate making a unit test so that we can be safe to regressions on this.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Search 3.3 CR2 ConcurrentModificationException
PostPosted: Tue Dec 14, 2010 9:52 pm 
Newbie

Joined: Tue Dec 14, 2010 4:06 am
Posts: 4
I downloaded the latest snapshot of 3.3 from 12/14 and I have not experienced this error with this version.

I will see about making a test case.


Top
 Profile  
 
 Post subject: Re: Search 3.3 CR2 ConcurrentModificationException
PostPosted: Wed Dec 15, 2010 5:15 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
I will see about making a test case.

Thank you that would be great.
There are examples of very simple testcases in the sourcecode, example: https://github.com/Sanne/hibernate-search/blob/master/hibernate-search/src/test/java/org/hibernate/search/test/embedded/nested/containedIn/NestedContainedInTest.java. Hope it helps.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Search 3.3 CR2 ConcurrentModificationException
PostPosted: Thu Dec 16, 2010 10:23 pm 
Newbie

Joined: Tue Dec 14, 2010 4:06 am
Posts: 4
I will try to get to this next week.

The end of the year is a busy time!


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