我在Spring Batch应用程序中将HikariCP与oracle.jdbc.OracleDriver一起使用。 当它在Oracle数据库中执行sql select查询时,第一个数据库会话将锁定另一个。我在数据库会话浏览器中看到它。 因此我失去了并行查询执行的优势。
如何配置我的应用程序来解决此问题?
27.02.2020 18:37:20.566|DEBUG|[threadPoolTaskScheduler-2] [o.s.jdbc.core.JdbcTemplate] Executing prepared SQL query
27.02.2020 18:37:20.566|DEBUG|[threadPoolTaskScheduler-1] [o.s.jdbc.core.JdbcTemplate] Executing prepared SQL query
27.02.2020 18:37:20.566|DEBUG|[threadPoolTaskScheduler-2] [o.s.jdbc.core.JdbcTemplate] Executing prepared SQL statement [SELECT COUNT(*)
FROM MY_TABLE_1 R
WHERE R.FDAY BETWEEN :START_DATE AND :END_DATE
and (select x.s_id from MY_TABLE_4 x where x.d_id = 3948) = 304243]
27.02.2020 18:37:20.566|DEBUG|[threadPoolTaskScheduler-1] [o.s.jdbc.core.JdbcTemplate] Executing prepared SQL statement [SELECT COUNT(*)
FROM MY_TABLE_2 R
WHERE R.FDAY BETWEEN :START_DATE AND :END_DATE
and (select x.s_id from MY_TABLE_4 x where x.d_id = 3948) = 304243]
27.02.2020 18:37:20.566|DEBUG|[threadPoolTaskScheduler-2] [o.s.jdbc.datasource.DataSourceUtils] Fetching JDBC Connection from DataSource
27.02.2020 18:37:20.566|DEBUG|[threadPoolTaskScheduler-1] [o.s.jdbc.datasource.DataSourceUtils] Fetching JDBC Connection from DataSource
27.02.2020 18:37:20.570|TRACE|[threadPoolTaskScheduler-1] [o.s.jdbc.core.StatementCreatorUtils] Setting SQL statement parameter value: column index 1, parameter value [2019-08-11], value class [java.sql.Date], SQL type unknown
27.02.2020 18:37:20.570|TRACE|[threadPoolTaskScheduler-1] [o.s.jdbc.core.StatementCreatorUtils] Setting SQL statement parameter value: column index 2, parameter value [2020-02-27], value class [java.sql.Date], SQL type unknown
27.02.2020 18:37:20.571|TRACE|[threadPoolTaskScheduler-2] [o.s.jdbc.core.StatementCreatorUtils] Setting SQL statement parameter value: column index 1, parameter value [2020-02-25], value class [java.sql.Date], SQL type unknown
27.02.2020 18:37:20.572|TRACE|[threadPoolTaskScheduler-2] [o.s.jdbc.core.StatementCreatorUtils] Setting SQL statement parameter value: column index 2, parameter value [2020-02-27], value class [java.sql.Date], SQL type unknown
27.02.2020 18:37:20.942|DEBUG|[threadPoolTaskScheduler-3] [o.s.jdbc.core.JdbcTemplate] Executing prepared SQL query
27.02.2020 18:37:20.942|DEBUG|[threadPoolTaskScheduler-3] [o.s.jdbc.core.JdbcTemplate] Executing prepared SQL statement [SELECT COUNT(*)
FROM MY_TABLE_3 U
WHERE U.FDAY BETWEEN :START_DATE AND :END_DATE
and (select x.s_id from MY_TABLE_4 x where x.d_id = 3948) = 304243]
27.02.2020 18:37:20.942|DEBUG|[threadPoolTaskScheduler-3] [o.s.jdbc.datasource.DataSourceUtils] Fetching JDBC Connection from DataSource
27.02.2020 18:37:20.948|TRACE|[threadPoolTaskScheduler-3] [o.s.jdbc.core.StatementCreatorUtils] Setting SQL statement parameter value: column index 1, parameter value [2018-03-29], value class [java.sql.Date], SQL type unknown
27.02.2020 18:37:20.948|TRACE|[threadPoolTaskScheduler-3] [o.s.jdbc.core.StatementCreatorUtils] Setting SQL statement parameter value: column index 2, parameter value [2020-02-27], value class [java.sql.Date], SQL type unknown