SQL Server pessimistic locking syntax incorrect for union-subclass

Description

Consider the class hierarchy Animal <- (Cat, Dog), mapped using the union-subclass, and the following query:

var query = session.CreateQuery("from Animal a where a.Name = ?");
query.SetLockMode("a", LockMode.Upgrade);

This code generates invalid SQL (using both 2000 and 2005 dialects) because the lock hints are inserted incorrectly. The SQL server error message states:

"Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon."

Environment

None

Activity

Show:

Alex Zaytsev 
September 8, 2014 at 11:31 AM

Close issues resolved in 3.3.3

Alex Zaytsev 
February 28, 2013 at 1:50 AM

Fixed in 3.3.x by commits

d98a279e679dbfc07aff75527578d6eac45b1aee
58c815e53a4d216148f4e14165973462df5f3dc9

Special thanks go to Dmitry Naumov

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created November 2, 2010 at 10:34 AM
Updated September 8, 2014 at 11:31 AM
Resolved February 28, 2013 at 1:50 AM
Who's Looking?