[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5791?page=c...
]
Gail Badner updated HHH-5791:
-----------------------------
Fix Version/s: 3.6.1
Summary: NullPointerException merging a transient entity with non-nullable
properties that are null if insert is delayed and check_nullability is false (was:
nullability of property is checked even if hibernate.check_nullability is set to false)
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
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira