Community
Participate
Working Groups
On SAP MaxDB, batching of UPDATE statements is not yet supported. To allow for optimistic verifications, EclipseLink compares the expected value of the version attribute with the value present on the database using an additional condition in the where-clause. Using the property <property name="eclipselink.jdbc.batch-writing" value="JDBC"/> EclipseLink can be advised to batch INSERT and UPDATE statements using a prepared statement batch. To detect optimistic verfification failures, EclipseLink has to distinguish wether a row has been updated sucessfully or whether a row was not found by the WHERE condition. Therefore, for every element in the batch, it needs to know whether a row has been changed or not. The PreparedStatement.executeBatch method returns an int[], which contains the number of changed rows. Unfortunately, JDBC also alows to return a general sucess indicator Statement.SUCCESS_NO_INFO, which does not allow the distnction between 1 row changed and no row changed. On MaxDB only SUCCESS_NO_INFO is returned. Fortunately, MaxDB allows to determine the total number of rows changed using the Statement.getUpdateCount method. This method could be leveraged to enable batching of UPDATE statements on MaxDB.
Created attachment 174758 [details] patch for this issue
Checked in in incubator at #7876.
Patch does not work with heterogenous non-parameterized Statement batches.
Created attachment 175058 [details] patch allowing to batch Statements as well
Checked in at rev #7906.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink