DaanHoogland commented on code in PR #13926:
URL: https://github.com/apache/cloudstack/pull/13926#discussion_r3823648886


##########
framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java:
##########
@@ -820,28 +820,37 @@ protected int update(ID id, UpdateBuilder ub, T entity) {
         }
         SearchCriteria<T> sc = createSearchCriteria();
         sc.addAnd(_idAttributes.get(_table)[0], SearchCriteria.Op.EQ, id);
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
-        txn.start();
-
+        final TransactionLegacy txn = TransactionLegacy.currentTxn();
+        boolean committed = false;
         try {
-            if (ub.getCollectionChanges() != null) {
-                insertElementCollection(entity, _idAttributes.get(_table)[0], 
id, ub.getCollectionChanges());
+            txn.start();
+
+            try {

Review Comment:
   a nested try-catch block in a method should be avoided.



-- 
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]

Reply via email to