Issue Details (XML | Word | Printable)

Key: HHH-2378
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Max Rydahl Andersen
Reporter: Max Rydahl Andersen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hibernate Core

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

Created: 24/Jan/07 05:56 AM   Updated: 24/Jan/07 08:47 AM
Component/s: core
Affects Version/s: 3.1, 3.1.1, 3.1.2, 3.2.0.alpha1, 3.2.0.alpha2, 3.1.3, 3.2.0 cr1, 3.2.0.cr2, 3.2.0.cr3, 3.2.0.cr4, 3.2.0.cr5, 3.2.0.ga, 3.2.1
Fix Version/s: 3.2.2

Time Tracking:
Not Specified


 Description  « Hide
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)



 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Max Rydahl Andersen added a comment - 24/Jan/07 08:47 AM
fixed in trunk / 3.2.

replicate now explicilty null's out oldVersion in case of non-versioned persister/entity