Skip to content

NH-3069 - Cannot use Session.Lock with Version column on abstract base class #1269

Closed
@nhibernate-bot

Description

@nhibernate-bot

Richard Lowden created an issue — 21st February 2012, 13:53:02:

When a version column is on an abstract base class and a joined subclass is used, when trying to use Session.Lock(entity, LockMode.Force) where entity is an instance of the subclass the incorrect SQL is generated.

The statement to try and increment the version number creates an update statement with the table name for the base class as expected, but the id column name as the column name from the sub-class table.

I believe the issue is in:

  • NHibernate.Persister.Entity.AbstractEntityPersister#GenerateVersionIncrementUpdateString()

Richard Lowden added a comment — 21st February 2012, 13:55:44:

Adding test case


Adam Rivera added a comment — 25th May 2012, 18:05:00:

Same issue here. :-(


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions