Closes #2299 - remove lock from the query when unnecessary

This commit is contained in:
Elena Mokeeva 2023-06-20 13:49:50 +02:00 committed by Elena Mokeeva
parent e0ae4b9907
commit 1a965a0619
1 changed files with 5 additions and 5 deletions

View File

@ -70,9 +70,11 @@ public class TaskQuerySqlProvider {
+ "ORDER BY <foreach item='item' collection='orderByOuter' separator=',' >${item}</foreach>"
+ "</if> "
+ "<if test='selectAndClaim == true'> "
+ "FETCH FIRST ROW ONLY FOR UPDATE"
+ "FETCH FIRST ROW ONLY FOR UPDATE "
+ "</if>"
+ "<if test=\"_databaseId == 'db2'\">WITH RS USE AND KEEP UPDATE LOCKS </if>"
+ "<if test=\"_databaseId == 'db2' and selectAndClaim \">WITH RS USE "
+ "AND KEEP UPDATE LOCKS </if>"
+ "<if test=\"_databaseId == 'db2' and !selectAndClaim \">WITH UR </if>"
+ CLOSING_SCRIPT_TAG;
}
@ -429,9 +431,7 @@ public class TaskQuerySqlProvider {
}
private static String openOuterClauseForGroupByPorOrSor() {
return "<if test=\"groupByPor or groupBySor != null\"> "
+ "SELECT * FROM ("
+ "</if> ";
return "<if test=\"groupByPor or groupBySor != null\"> " + "SELECT * FROM (" + "</if> ";
}
private static String closeOuterClauseForGroupByPor() {