budaidev commented on code in PR #5966:
URL: https://github.com/apache/fineract/pull/5966#discussion_r3387600564


##########
fineract-core/src/main/java/org/apache/fineract/commands/service/CommandSourceService.java:
##########
@@ -96,10 +96,19 @@ public CommandSource saveResultNewTransaction(@NonNull 
CommandSource commandSour
     }
 
     @Transactional(propagation = Propagation.REQUIRED)
-    public CommandSource saveResultSameTransaction(@NonNull CommandSource 
commandSource) {
+    public CommandSource saveResultInTransaction(@NonNull CommandSource 
commandSource) {
         return saveResult(commandSource);
     }
 
+    @Transactional(propagation = Propagation.REQUIRED)
+    public void saveResultInTransaction(Long commandSourceId, Integer 
response, String body) {

Review Comment:
   minor: this might swallow possible errors if the commandSource is not found. 
Also I would say this function is updating instead of saving, but it's fine



##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/core/service/database/RoutingDataSource.java:
##########
@@ -54,6 +76,83 @@ public DataSource determineTargetDataSource() {
 
     @Override
     public Connection getConnection(final String username, final String 
password) throws SQLException {
-        return determineTargetDataSource().getConnection(username, password);
+        DataSource targetDataSource = determineTargetDataSource();
+        try {
+            Connection connection = targetDataSource.getConnection(username, 
password);
+            logConnectionCheckout(targetDataSource, username);
+            return connection;
+        } catch (SQLException e) {
+            logConnectionCheckoutFailure(targetDataSource, username, e);
+            throw e;
+        }
+    }
+
+    private void logConnectionCheckout(DataSource targetDataSource, String 
username) {
+        if (!connectionCheckoutDiagnosticsEnabled) {
+            return;
+        }
+        log.info("Tenant datasource connection checkout: tenant={}, 
username={}, transaction={}, hikari={}, stack={}", tenant(),

Review Comment:
   minor: should we handle this on info level? I would say it's a debug level 
information.



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