Issue Type: Bug Bug
Affects Versions: 4.1.5.SP1, 4.1.6, 4.1.5
Assignee: Unassigned
Components: envers
Created: 22/Aug/12 4:53 PM
Description:

With version 4.1.5 the EnversPostUpdateEventListenerImpl.postUpdateDBState was introduced.
When you lock into the org.hibernate.engine.internal.TwoPhaseLoad.addUninitializedEntity(EntityKey, Object, EntityPersister, LockMode, boolean, SessionImplementor) method, you'll see that the loadedState is set to NULL.

Stacktrace
java.lang.NullPointerException
    at org.hibernate.envers.event.EnversPostUpdateEventListenerImpl.postUpdateDBState(EnversPostUpdateEventListenerImpl.java:86)
    at org.hibernate.envers.event.EnversPostUpdateEventListenerImpl.onPostUpdate(EnversPostUpdateEventListenerImpl.java:53)
    at org.hibernate.action.internal.EntityUpdateAction.postUpdate(EntityUpdateAction.java:255)
    at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:212)
    at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:276)
    at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326)
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1214)
    at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:403)
    at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104)
    at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53)
    at ...
Environment: hibernate 4.1.6.Final, weblogic 12.1.1, oracle 11g
Project: Hibernate ORM
Priority: Critical Critical
Reporter: Nils Probson
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira