LockMode With Subclasses
Posted
by Lester
on Stack Overflow
See other posts from Stack Overflow
or by Lester
Published on 2010-05-21T02:11:46Z
Indexed on
2010/05/21
2:20 UTC
Read the original article
Hit count: 333
fluent-nhibernate
I'm using Fluent Nhibernate with the following query on DerivedClass which extends BaseClass:
var query = Session.CreateCriteria<DerivedClass>().SetLockMode(LockMode.Upgrade)
What I want is the lock hints (updlock, rowlock)
to be applied to both DerivedClass and BaseClass, but the generated SQL only applies the lock hints to DerivedClass:
SELECT * FROM DerivedClass this_ with (updlock, rowlock) inner join [BaseClass] this_1_ on
this_.Id=this_1_.Id WHERE ...
This is the same situation described in http://opensource.atlassian.com/projects/hibernate/browse/HHH-2392
If anyone could point me in the right direction it would be much appreciated.
© Stack Overflow or respective owner