Details
-
Bug
-
Status: Open (View Workflow)
-
Blocker
-
Resolution: Unresolved
-
3.5.1
-
None
-
None
-
None
-
Test container docker
Description
When using stored procedures, if one batch fails (e.g., due to a primary key or unique key violation), all subsequent batches in the same session also fail, even when there are no issues with the following batches.
The stored procedure is essentially an Insert operation.
Steps Taken:
In the catch block, I ensure to:
Call connection.rollback(); to roll back the current transaction.
Call preparedStatement.clearBatch(); to clear any pending batches.
These steps work as expected for regular CRUD operations but have no effect when the batch contains stored procedure calls.
If i understand the issue well this sample must reproduce the issue :
@Test
Statement stmt = sharedConn.createStatement();
call1.execute();
call1.addBatch();
call1.addBatch();
call1.executeBatch();
call1.addBatch();
call1.addBatch();
call1.addBatch();
call1.addBatch();
call1.executeBatch();
}
}
but didn't. Am i missing something ?