[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4964) NullPointerException instead of StaleStateException when using natural-id in mapping

Dzmitry Petrushenka (JIRA) noreply at atlassian.com
Tue Mar 2 10:55:47 EST 2010


NullPointerException instead of StaleStateException when using natural-id in mapping
------------------------------------------------------------------------------------

                 Key: HHH-4964
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4964
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
         Environment: Hibernate 3.3.2.GA, DB2 UDB 9.5
            Reporter: Dzmitry Petrushenka
         Attachments: src.zip

Use natural-id in a mapping for Foo entity.

1. First transaction creates an instance of this entity.

2. The second transaction deletes this entity.

3. The third transaction tries to update this object.

NullPointerException happens instead of throwing StaleStateException.

Exception in thread "main" java.lang.NullPointerException
	at org.hibernate.event.def.DefaultFlushEntityEventListener.checkNaturalId(DefaultFlushEntityEventListener.java:112)
	at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:192)
	at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:143)
	at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
	at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)
	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
	at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
	at example.bug1.FooTest.main(FooTest.java:39)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list