Commit db65eac63806591b54bd93816d6126e69f53f1aa
Committed by
Andrew Shvayka
1 parent
118c81da
added better logging to ts upgrade
Showing
1 changed file
with
10 additions
and
0 deletions
@@ -25,6 +25,7 @@ import java.nio.file.Path; | @@ -25,6 +25,7 @@ import java.nio.file.Path; | ||
25 | import java.sql.CallableStatement; | 25 | import java.sql.CallableStatement; |
26 | import java.sql.Connection; | 26 | import java.sql.Connection; |
27 | import java.sql.SQLException; | 27 | import java.sql.SQLException; |
28 | +import java.sql.SQLWarning; | ||
28 | import java.sql.Types; | 29 | import java.sql.Types; |
29 | 30 | ||
30 | @Slf4j | 31 | @Slf4j |
@@ -93,6 +94,15 @@ public abstract class AbstractSqlTsDatabaseUpgradeService { | @@ -93,6 +94,15 @@ public abstract class AbstractSqlTsDatabaseUpgradeService { | ||
93 | try { | 94 | try { |
94 | CallableStatement callableStatement = conn.prepareCall("{" + query + "}"); | 95 | CallableStatement callableStatement = conn.prepareCall("{" + query + "}"); |
95 | callableStatement.execute(); | 96 | callableStatement.execute(); |
97 | + SQLWarning warnings = callableStatement.getWarnings(); | ||
98 | + if (warnings != null) { | ||
99 | + log.info("{}", warnings.getMessage()); | ||
100 | + SQLWarning nextWarning = warnings.getNextWarning(); | ||
101 | + while (nextWarning != null) { | ||
102 | + log.info("{}", nextWarning.getMessage()); | ||
103 | + nextWarning = nextWarning.getNextWarning(); | ||
104 | + } | ||
105 | + } | ||
96 | callableStatement.close(); | 106 | callableStatement.close(); |
97 | log.info(SUCCESSFULLY_EXECUTED_FUNCTION, query.replace(CALL_REGEX, "")); | 107 | log.info(SUCCESSFULLY_EXECUTED_FUNCTION, query.replace(CALL_REGEX, "")); |
98 | Thread.sleep(2000); | 108 | Thread.sleep(2000); |