shardingsphere-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [shardingsphere] justbk2015 commented on a change in pull request #12318: [feature] add scaling adapt feature for openGauss
Date Sat, 11 Sep 2021 02:04:12 GMT

justbk2015 commented on a change in pull request #12318:
URL: https://github.com/apache/shardingsphere/pull/12318#discussion_r706542356



##########
File path: shardingsphere-scaling/shardingsphere-scaling-dialect/shardingsphere-scaling-postgresql/src/main/java/org/apache/shardingsphere/scaling/postgresql/component/PostgreSQLWalDumper.java
##########
@@ -75,16 +77,19 @@ public void start() {
     }
     
     private void dump() {
-        try (Connection pgConnection = logicalReplication.createPgConnection((StandardJDBCDataSourceConfiguration)
dumperConfig.getDataSourceConfig());
-             PGReplicationStream stream = logicalReplication.createReplicationStream(pgConnection,
PostgreSQLPositionInitializer.SLOT_NAME, walPosition.getLogSequenceNumber())) {
-            DecodingPlugin decodingPlugin = new TestDecodingPlugin(pgConnection.unwrap(PgConnection.class).getTimestampUtils());
+        try {
+            Connection pgConnection = logicalReplication.createPgConnection((StandardJDBCDataSourceConfiguration)
dumperConfig.getDataSourceConfig());
+            PostgreSQLTimestampUtils utils = new PostgreSQLTimestampUtils(pgConnection.unwrap(PgConnection.class).getTimestampUtils());
+            DecodingPlugin decodingPlugin = new TestDecodingPlugin(utils);
+            PGReplicationStream stream = logicalReplication.createReplicationStream(pgConnection,
PostgreSQLPositionInitializer.SLOT_NAME, walPosition.getLogSequenceNumber());

Review comment:
       I have already add try-resource, with Connection.
   stream no need to close, if called close, the database will throw SQLException info: backend
close except.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message