yuqi1129 commented on code in PR #5426:
URL: https://github.com/apache/gravitino/pull/5426#discussion_r1830298592


##########
core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java:
##########
@@ -231,7 +231,7 @@ public boolean deleteMetalake(NameIdentifier ident, boolean 
cascade) {
             () ->
                 SessionUtils.doWithoutCommit(
                     SecurableObjectMapper.class,
-                    mapper -> 
mapper.softDeleteRoleMetasByMetalakeId(metalakeId)),
+                    mapper -> 
mapper.softDeleteSecurableObjectsByMetalakeId(metalakeId)),

Review Comment:
   Is this just a fix to a problem that existed before? I reviewed the code, 
L230 has the same code if it's not modified.



##########
core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java:
##########
@@ -229,6 +231,31 @@ public boolean deleteTable(NameIdentifier identifier) {
           if (deleteResult.get() > 0) {
             
TableColumnMetaService.getInstance().deleteColumnsByTableId(tableId);
           }
+        },
+        () -> {
+          if (deleteResult.get() > 0) {
+            SessionUtils.doWithoutCommit(
+                SecurableObjectMapper.class,
+                mapper ->
+                    mapper.softDeleteObjectRelsByMetadataObject(
+                        tableId, MetadataObject.Type.TABLE.name()));
+          }
+        },
+        () -> {
+          if (deleteResult.get() > 0) {
+            SessionUtils.doWithoutCommit(
+                TagMetadataObjectRelMapper.class,
+                mapper ->
+                    mapper.softDeleteTagMetadataObjectRelsByMetadataObject(
+                        tableId, MetadataObject.Type.TABLE.name()));
+          }
+        },
+        () -> {
+          if (deleteResult.get() > 0) {
+            SessionUtils.doWithoutCommit(
+                TagMetadataObjectRelMapper.class,
+                mapper -> 
mapper.softDeleteTagMetadataObjectRelsByTableId(tableId));
+          }

Review Comment:
   Can we merge this operation into one like 
   
   if (deleteResult.get() > 0) {
       
      // one
      SessionUtils.doWithoutCommit()
     
     // two
     SessionUtils.doWithoutCommit()
    
     ...
   }



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