[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-5791) NullPointerException merging a transient entity with non-nullable properties that are null if insert is delayed and check_nullability is false

Gail Badner (JIRA) noreply at atlassian.com
Fri Dec 17 20:02:13 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner resolved HHH-5791.
------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0.0.Alpha1

Fixed in hibernate-core master and 3.6.

> NullPointerException merging a transient entity with non-nullable properties that are null if insert is delayed and check_nullability is false
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5791
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5791
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.6.0
>         Environment: Hibernate 3.6.0-Final, MySQL
>            Reporter: Paweł Kępka
>            Assignee: Gail Badner
>             Fix For: 3.6.1, 4.0.0.Alpha1
>
>
> In our application we use a subclass of org.hibernate.cfg.beanvalidation.BeanValidationEventListener which integrates with Spring for entity validation.
> In order to wire our class we use following configuration:
> hibernate.ejb.event.pre-update=com.acme.SpringBeanValidationEventListener
> hibernate.ejb.event.pre-insert=com.acme.SpringBeanValidationEventListener
> javax.persistence.validation.mode=none
> hibernate.check_nullability=false
> But this stopped to work when we tried to switch from Hibernate 3.5.3 to 3.6.0.
> When we try to merge an entity which has a null property with @NotNull annotation and nullable set to false we get:
> java.lang.NullPointerException: null entities are not supported by org.hibernate.event.def.EventCache
> 	at org.hibernate.event.def.EventCache.containsKey(EventCache.java:80)
> 	at org.hibernate.event.def.DefaultMergeEventListener.mergeTransientEntity(DefaultMergeEventListener.java:361)
> 	at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:303)
> 	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:258)
> 	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
> 	at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
> 	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
> 	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
> 	at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:686)
> instead of ConstraintViolationException. Setting nullable to true resolves the problem but it is temporary solution only.
> The whole issues might to be related to HHH-5437. 

-- 
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