NullPointerException in PreCollectionRemove Listener

Description

I'm getting a NullPointerException on line 47 of EnversPreCollectionRemoveEventListenerImpl very consistently. I wasn't sure if it was due to lazy collections or not, but it seems that it fails if they're eagerly fetched or lazily fetched. I'm guessing it has something to do with getLoadedPersister() returning a null value since the comments for it say "This is only available late during the flush cycle". The stack trace is
Quote:
java.lang.NullPointerException
at org.hibernate.envers.event.EnversPreCollectionRemoveEventListenerImpl.onPreRemoveCollection(EnversPreCollectionRemoveEventListenerImpl.java:47)
at org.hibernate.action.internal.CollectionRemoveAction.preRemove(CollectionRemoveAction.java:143)
at org.hibernate.action.internal.CollectionRemoveAction.execute(CollectionRemoveAction.java:104)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:188)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:323)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1081)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:315)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:73)
... 120 more

Environment

Hibernate 4.0.0 to MySQL

Status

Assignee

Gail Badner

Reporter

Kevin Jordan

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.0.0.Final

Priority

Major
Configure