Issue Details (XML | Word | Printable)

Key: HHH-2242
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Steve Ebersole
Reporter: Phillip Tornroth
Votes: 0
Watchers: 0
Operations

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

Consider Allowing Optimistic Lock Strategies other than 'Version' with joined-subclass

Created: 14/Nov/06 04:56 PM   Updated: 21/Nov/06 05:29 PM
Component/s: core, documentation
Affects Version/s: 3.2.0.ga
Fix Version/s: 3.2.2

Time Tracking:
Not Specified


 Description  « Hide
The JoinedSubclassEntityPersister class explicitly disallows mapping joined-subclasses whenever an optimistic locking strategy of other than 'version' is used. It would be very useful to choose an optimistic locking strategy independent of an inheritance mapping strategy. In my case, I'm using 'none' for legacy reasons. If there's a good reason for continuing to enforce this constraint, it would be very helpful to document it in the hibernate reference.

Thanks in advance...

 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Steve Ebersole added a comment - 21/Nov/06 05:29 PM
In theory, "none" should be fine. Conceptually a joined-subclass would support optimistic-locking="none|version" (please note that version really means version or timestamp).

However, the two property-based optimisitc locking schemes (all & dirty) are conceptually not correct with joined-subclasses. We could relax that if we enforced that all properties actually used in optimistic locking occurred in the "base table". But thats not worth the effort.

Not sure if you realize, though, but optimisitc-locking="none" is exactly the same thing as optimisitc-locking="version" (or specifying nothing for this attribute) and then *not* defining a <version/> or <timetsamp/>...

Anyway, its trivial to change it. So I went ahead and changed the code to explicitly allow optimisitc-locking="none" on joined-subclass.

trunk / 3.2