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


##########
core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessions.java:
##########
@@ -52,8 +62,8 @@ public static SqlSession getSqlSession() {
               .getSqlSessionFactory()
               .openSession(TransactionIsolationLevel.READ_COMMITTED);
       sessions.set(sqlSession);
-      return sqlSession;
     }
+    sessionCount.set(sessionCount.get() + 1);

Review Comment:
   Thanks for the suggestion. While the ThreadLocal already ensures thread 
safety here, I agree that using `AtomicInteger` makes the intent of a counter 
more explicit and the code cleaner. I've made the change.



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