Skip to content

Commit 3246df4

Browse files
committed
NH-3710 - Corrected usage of aliasedLockModes
1 parent 2e7764a commit 3246df4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/NHibernate/Loader/Criteria/CriteriaLoader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected override SqlString ApplyLocks(SqlString sqlSelectString, IDictionary<s
165165
return sqlSelectString;
166166
}
167167

168-
//Dictionary<string, LockMode> aliasedLockModes = new Dictionary<string, LockMode>();
168+
Dictionary<string, LockMode> aliasedLockModes = new Dictionary<string, LockMode>();
169169
Dictionary<string, string[]> keyColumnNames = dialect.ForUpdateOfColumns ? new Dictionary<string, string[]>() : null;
170170
string[] drivingSqlAliases = Aliases;
171171

@@ -179,7 +179,7 @@ protected override SqlString ApplyLocks(SqlString sqlSelectString, IDictionary<s
179179
{
180180
ILockable drivingPersister = (ILockable)EntityPersisters[i];
181181
string rootSqlAlias = drivingPersister.GetRootTableAlias(drivingSqlAliases[i]);
182-
//aliasedLockModes[rootSqlAlias] = lockMode;
182+
aliasedLockModes[rootSqlAlias] = lockMode;
183183
if (keyColumnNames != null)
184184
{
185185
keyColumnNames[rootSqlAlias] = drivingPersister.RootTableIdentifierColumnNames;
@@ -188,7 +188,7 @@ protected override SqlString ApplyLocks(SqlString sqlSelectString, IDictionary<s
188188
}
189189
}
190190

191-
return dialect.ApplyLocksToSql(sqlSelectString, lockModes, keyColumnNames);
191+
return dialect.ApplyLocksToSql(sqlSelectString, aliasedLockModes, keyColumnNames);
192192
}
193193

194194
public override LockMode[] GetLockModes(IDictionary<string, LockMode> lockModes)

0 commit comments

Comments
 (0)