Query.executeUpdate() Returning Wrong Number Of Records That Been Modifed (Doc ID 1934437.1)

Last updated on OCTOBER 14, 2014

Applies to:

Oracle TopLink - Version 11.1.1.4.0 and later
Information in this document applies to any platform.

Symptoms

Using toplink 11.1.1.4.0 (eclipselink 2.1.2) in production environment,
a potential defect was discovered.

when a JPQL or a native SQL to update or delete records through query.executeUpdate() is issued,
the method always return 1 no matter how many rows of records had actually been updated/deleted.

Code snippet

and the return result 'modifiedNum' is always be '1'.

And it was observed that if 'eclipselink.jdbc.batch-writing' was changed from 'JDBC' to 'Buffered' in persistence.xml,
the returning result of query that created with JPQL will be correct. But query that created from native SQL still got that problem.



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms