JDBC BatchUpdateException.getUpdateCounts() Incorrect When PK Violation Against Partitioned Table
(Doc ID 1462943.1)
Last updated on MARCH 23, 2021
Applies to:JDBC - Version 18.104.22.168.0 and later
Information in this document applies to any platform.
When a set of batched prepared statement inserts to a partitioned table fails due to a primary key constraint violation, the JDBC BatchUpdateException.getUpdateCounts() method returns an array of -2 (java.sql.Statement.SUCCESS_NO_INFO) status counts. Since none of the batched inserts were successfully added to the table, getUpdateCounts should return -3 (Statement.EXECUTE_FAILED) instead, as described as expected on page 23-13 of the Oracle Database JDBC Developer's Guide and Reference.
Oracle® Database JDBC Developer's Guide
11g Release 2 (11.2)
23 Performance Extensions
This problem occurs with Oracle 22.214.171.124.0 JDBC driver using standard JDBC prepared statement update batching using a partitioned table.
It is observed with both 10.2.0.3.0 and 126.96.36.199.0 database server versions.
The 10.2.0.4.0 JDBC driver works correctly (returns -3 update counts), as does the 188.8.131.52.0 JDBC driver when using a non-partitioned table.
The issue does not occur when using JDBC OCI. The problem occurs only with JDBC Thin 11g and when inserting to a partitioned table.
Upgrade of JDBC driver from 10.2.0.4 to 184.108.40.206.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document