[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2378) replicate() of non-versioned entiy can result in wrong value for version in entity cache

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Wed Jan 24 06:56:20 EST 2007


replicate() of non-versioned entiy can result in wrong value for version in entity cache
----------------------------------------------------------------------------------------

         Key: HHH-2378
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2378
     Project: Hibernate3
        Type: Bug

  Components: core  
    Versions: 3.2.0.alpha1, 3.1.1, 3.1.2, 3.1, 3.1.3, 3.2.0.alpha2, 3.2.0 cr1, 3.2.0.cr2, 3.2.1, 3.2.0.cr3, 3.2.0.cr4, 3.2.0.ga, 3.2.0.cr5    
    Reporter: Max Rydahl Andersen
     Fix For: 3.2.2


if replication is called on a non-versioned entity and the entity already exists in the db it can result in the persister it self being stored as the version value for the entity (because AbstractEntityPersister.getCurrentVersion(..) returns any object if row exists and non-versioned). 

This result in a NPE in Lock.isPuttable because version is suddenly not null and thus a comparison is done wrongly.

eg.
Caused by: java.lang.NullPointerException
	at org.hibernate.cache.ReadWriteCache$Lock.isPuttable(ReadWriteCache.java:460)
	at org.hibernate.cache.ReadWriteCache.put(ReadWriteCache.java:155)
	at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:153)
	at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
	at org.hibernate.loader.Loader.doQuery(Loader.java:717)



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