[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2236?page=all ]
Max Rydahl Andersen closed HHH-2236:
------------------------------------
Fix Version: 3.2.1
Resolution: Fixed
fix + test committed to branch_3_2 and trunk.
Lazy property + setReadOnly + Instrumented classes results in
NullPointerException when accessing lazy property
---------------------------------------------------------------------------------------------------------------
Key: HHH-2236
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2236
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.ga
Reporter: Max Rydahl Andersen
Fix For: 3.2.1
<property name="data" lazy="true">
will give NPE on instrumented classes if you do :
p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true
).list().get( 0 );
p1.getData(); // NPE's because of missing snapshot
java.lang.NullPointerException
at
org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyProperty(AbstractEntityPersister.java:856)
at
org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyPropertiesFromDatastore(AbstractEntityPersister.java:786)
at
org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyProperty(AbstractEntityPersister.java:750)
at
org.hibernate.intercept.AbstractFieldInterceptor.intercept(AbstractFieldInterceptor.java:75)
at
org.hibernate.intercept.cglib.FieldInterceptorImpl.readObject(FieldInterceptorImpl.java:75)
at org.hibernate.test.instrument.domain.Problematic.$cglib_read_bytes(Problematic.java)
at org.hibernate.test.instrument.domain.Problematic.getData(Problematic.java:41)
--
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