vert-x3 / vertx-jdbc-client

JDBC support for Vert.x
Apache License 2.0
125 stars 90 forks source link

Broken Batch logic with Oracle in Vert.x 4.3.5+ #310

Open u-ways opened 1 year ago

u-ways commented 1 year ago

Hello, I am sharing a demo of broken Batch logic with Oracle Database in Vert.x 4.3.5+ JDBC client.

Version

4.4.5

Context

It seems that the client assumes all vendors support DLM returning clause on batching. However, this is not the cause with Oracle.

After trying to find a simple way to disable the DLM returning with no success, we settled with a transacted insert loop. You can see a similar issue for another framework here: Micronaut #991 - Oracle - Batch w/ DML Returning

Do you have a reproducer?

Yes, a Java 17 project with a containerised database service has been created with multiple test scenarios. See:

The project contains testing code that will demonstrate the issue. Those tests can be found here:

Tests that fail with 4.4.5, will have the comment: // FIXME: FAILS WITH 4.4.5.

tsegismont commented 10 months ago

This happens because generated keys retrieval must disabled when executing a batch.

But with the SQL Client API, this is only possible when configuring the JDBCConnectioOptions

We need specific prepare options to disable generated keys retrieval