I could reproduce the same problem by just running the Hibernate Search testsuite, from master just changing the hibernate-core dependency from 4.1.6 to 4.1.7
The failing test is org.hibernate.search.test.embedded.EmbeddedTest in the "hibernate-search-orm" Maven module, and reproduces exactly the same stacktrace as reported by Guillaume. In this case we are in a "before transaction completion" phase, iterating over a previously non-initialized collection. As you say, it's not finding the CollectionEntry; it would be very nice if you could review your patch using this test to debug? Sanne On 10 September 2012 17:55, Shawn Clowater <shawn.clowa...@entero.com> wrote: > Guillaume, > > Are you using any type of nested sessions in your code? Steve applied a > patch that I created that now properly triggers the before transaction > events in that case now (I had an issue with Search and it blowing an > exception around sealing queues w/o it). This may be why you're now > seeing an issue in 4.1.7 and not 4.1.6. > > I'm not looking at the latest code but in 4.1.4 it looks like the > getLoadedCollectionOwnerOrNull can blow a NPE if the CollectionEntry > wasn't found but a test case is worth a thousand words. > > Shawn Clowater > > -----Original Message----- > From: hibernate-dev-boun...@lists.jboss.org > [mailto:hibernate-dev-boun...@lists.jboss.org] On Behalf Of Steve > Ebersole > Sent: Monday, September 10, 2012 8:53 AM > To: Guillaume Smet > Cc: Hibernate > Subject: Re: [hibernate-dev] Regression after upgrade to 4.1.7.Final > > We are going to need a test (ideally without Search) reproducing this. > > On 09/10/2012 03:28 AM, Guillaume Smet wrote: >> Hi, >> >> We just upgraded to Hibernate 4.1.7.Final (from 4.1.6.Final) and we >> have a pretty bad regression with 4.1.7 and Hibernate Search 4.1.1. >> >> We have the following stack trace when saving an object: >> Caused by: org.hibernate.HibernateException: Error while indexing in >> Hibernate Search (before transaction completion) >> at > org.hibernate.search.backend.impl.EventSourceTransactionContext$Delegate > ToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTra > nsactionContext.java:186) >> at > org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQ > ueue.beforeTransactionCompletion(ActionQueue.java:662) >> at > org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQ > ueue.java:307) >> at > org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionIm > pl.java:607) >> at > org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTra > nsactionCommit(JdbcTransaction.java:105) >> at > org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(Abst > ractTransactionImpl.java:175) >> at > org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:75) >> at > org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactio > nManager.java:512) >> ... 47 more >> Caused by: java.lang.NullPointerException >> at > org.hibernate.engine.internal.StatefulPersistenceContext.getLoadedCollec > tionOwnerOrNull(StatefulPersistenceContext.java:851) >> at > org.hibernate.event.spi.AbstractCollectionEvent.getLoadedOwnerOrNull(Abs > tractCollectionEvent.java:75) >> at > org.hibernate.event.spi.InitializeCollectionEvent.<init>(InitializeColle > ctionEvent.java:36) >> at > org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java > :1799) >> at > org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork( > AbstractPersistentCollection.java:524) >> at > org.hibernate.collection.internal.AbstractPersistentCollection.withTempo > rarySessionIfNeeded(AbstractPersistentCollection.java:212) >> at > org.hibernate.collection.internal.AbstractPersistentCollection.initializ > e(AbstractPersistentCollection.java:520) >> at > org.hibernate.collection.internal.AbstractPersistentCollection.read(Abst > ractPersistentCollection.java:125) >> at > org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.j > ava:266) >> at > org.hibernate.search.engine.spi.AbstractDocumentBuilder.appendContainedI > nWorkForInstance(AbstractDocumentBuilder.java:296) >> at > org.hibernate.search.engine.impl.WorkPlan$PerEntityWork.processContained > In(WorkPlan.java:525) >> at > org.hibernate.search.engine.impl.WorkPlan$PerClassWork.processContainedI > nAndPrepareExecution(WorkPlan.java:297) >> at > org.hibernate.search.engine.impl.WorkPlan.processContainedInAndPrepareEx > ecution(WorkPlan.java:144) >> at > org.hibernate.search.backend.impl.WorkQueue.prepareWorkPlan(WorkQueue.ja > va:135) >> at > org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks( > BatchedQueueingProcessor.java:71) >> at > org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronizatio > n.beforeCompletion(PostTransactionWorkQueueSynchronization.java:86) >> at > org.hibernate.search.backend.impl.EventSourceTransactionContext$Delegate > ToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTra > nsactionContext.java:183) >> ... 54 more >> >> I don't know if it's something obvious or if you need a self contained >> test case to reproduce it. >> >> I haven't created a JIRA because I don't know if it's an >> incompatibility between Hibernate Search 4.1.1 and Hibernate 4.1.7 or >> a real bug (either in HHH or HSEARCH). >> >> Feel free to ping me for more information or any further action. >> >> Thanks. >> > > > -- > st...@hibernate.org > http://hibernate.org > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev _______________________________________________ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev