Version is incremented when an inverse one-to-many collection is dirtied by adding or removing read-only entities

Description

If a persistent, read-only entity is added to an inverse one-to-many association, and the owning entity is versioned, then, when flushed, the collection is found to be dirty, the owning entity's version is incremented, but the read-only entity is not actually added or removed from collection.

This does not happen when the association is non-inverse.

This situation should at least be logged.

Activity

Show:

Julian Maughan October 31, 2010 at 11:43 AM

I've completed a port of the Hibernate 'read-only Session/Criteria' for NHibernate. However, I'm having trouble getting the following tests to pass: readonly/testMergeDetachedChildWithNewParentCommitWithReadOnlyChild [1] and readonly/testGetChildMakeReadOnlyThenMergeDetachedChildWithNewParent [2]. Are these tests expected to pass? They aren't marked 'FailureExpected', but neither has this issue been Resolved.

Former user March 10, 2010 at 11:52 AM

This is reproduced by VersionedEntityWithInverseOneToManyFailureExpectedTest and VersionedEntityWithInverseOneToManyJoinFailureExpectedTest in
org.hibernate.test.immutable.entitywithmutablecollection.inverse.

Details

Assignee

Reporter

Components

Affects versions

Priority

Created March 10, 2010 at 11:49 AM
Updated February 13, 2025 at 12:52 PM