rmannibucau commented on code in PR #144:
URL: https://github.com/apache/openjpa/pull/144#discussion_r3426812145
##########
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java:
##########
@@ -120,14 +120,21 @@ protected void flushAndUpdate(RowImpl row)
try {
int count = executeUpdate(stmnt, sql, row);
if (count != 1) {
- logSQLWarnings(stmnt);
- 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),
- sql).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:
same, to review if we don't loop a case there
--
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]