thenatog commented on a change in pull request #4416:
URL: https://github.com/apache/nifi/pull/4416#discussion_r459659479
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/src/main/java/org/apache/nifi/admin/service/impl/StandardKeyService.java
##########
@@ -118,11 +118,16 @@ public void deleteKey(String identity) {
transaction = transactionBuilder.start();
// delete the keys
- DeleteKeysAction deleteKeys = new DeleteKeysAction(identity);
- transaction.execute(deleteKeys);
-
- // commit the transaction
- transaction.commit();
+ DeleteKeyAction deleteKey = new DeleteKeyAction(keyId);
+ Integer rowsDeleted = transaction.execute(deleteKey);
+
+ // commit the transaction if we found one and only one matching
keyId/user identity
+ if (rowsDeleted == 1) {
Review comment:
I don't believe there was a specific condition I knew of, I just wasn't
sure. I think the naming and possibly a comment had implied to me it was
possible to delete multiple rows using the identity. Sounds like that's not an
issue. As such, the method can remain as shown.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]