Pull-request for HHH-3961
This commit is contained in:
parent
606752f867
commit
d81f65715b
|
@ -27,6 +27,7 @@ import java.sql.Types;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.dialect.function.NoArgSQLFunction;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
|
||||
|
@ -196,4 +197,13 @@ public class SQLServer2005Dialect extends SQLServerDialect {
|
|||
// Insert after the select statement the row_number() function:
|
||||
sql.insert( selectEndIndex - 1, ", ROW_NUMBER() OVER (" + orderby + ") as __hibernate_row_nr__" );
|
||||
}
|
||||
|
||||
@Override // since SQLServer2005 the nowait hint is supported
|
||||
public String appendLockHint(LockMode mode, String tableName) {
|
||||
if ( mode == LockMode.UPGRADE_NOWAIT )
|
||||
{
|
||||
return tableName + " with (updlock, rowlock, nowait)";
|
||||
}
|
||||
return super.appendLockHint(mode, tableName);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue