Query.executeUpdate() Returning Wrong Number Of Records That Been Modifed
Last updated on OCTOBER 14, 2014
Applies to:Oracle TopLink - Version 184.108.40.206.0 and later
Information in this document applies to any platform.
Using toplink 220.127.116.11.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.
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.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
Million Knowledge Articles and hundreds of Community platforms