jerryshao commented on code in PR #8242:
URL: https://github.com/apache/gravitino/pull/8242#discussion_r2300132420


##########
core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessions.java:
##########
@@ -62,53 +72,68 @@ public static SqlSession getSqlSession() {
    * thread local storage.
    */
   public static void commitAndCloseSqlSession() {
-    SqlSession sqlSession = sessions.get();
-    if (sqlSession != null) {
-      try {
-        sqlSession.commit();
-        sqlSession.close();
-      } finally {
-        sessions.remove();
-      }
-    }
+    handleSessionClose(true, false);

Review Comment:
   Can you change all the code style to `handleSessionClose(true /** commit */, 
false /** rollback */);` for better review.



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