rmannibucau commented on code in PR #144:
URL: https://github.com/apache/openjpa/pull/144#discussion_r3426797320
##########
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java:
##########
@@ -254,13 +254,22 @@ private void flushSingleRow(RowImpl row,
PreparedStatement ps)
row.flush(ps, _dict, _store);
int count = executeUpdate(ps, row.getSQL(_dict), row);
if (count != 1) {
- logSQLWarnings(ps);
- Object failed = row.getFailedObject();
- if (failed != null)
- _exceptions.add(new OptimisticException(failed));
- else if (row.getAction() == Row.ACTION_INSERT)
- throw new SQLException(_loc.get("update-failed-no-failed-obj",
- String.valueOf(count), row.getSQL(_dict)).getMessage());
+ // For DELETE actions, tolerate count=0 because the row may
+ // have already been removed by a database-level ON DELETE
+ // CASCADE triggered by a related row's deletion.
+ if (count == 0 && row.getAction() == Row.ACTION_DELETE) {
Review Comment:
is this by spec? how do I know my delete was a noop as a caller now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]