You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "FlyingZC (via GitHub)" <gi...@apache.org> on 2023/02/10 05:43:16 UTC

[GitHub] [shardingsphere] FlyingZC opened a new pull request, #24099: Fix statement cache not closed when connection is closed(#24070)

FlyingZC opened a new pull request, #24099:
URL: https://github.com/apache/shardingsphere/pull/24099

   Fixes #24070.
   
   Changes proposed in this pull request:
     - Fix statement cache not closed when connection is closed
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [x] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [x] I have added corresponding unit tests for my changes.
   


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


[GitHub] [shardingsphere] codecov-commenter commented on pull request #24099: Fix statement cache not closed when connection is closed(#24070)

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24099:
URL: https://github.com/apache/shardingsphere/pull/24099#issuecomment-1425244685

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#24099](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5d32348) into [master](https://codecov.io/gh/apache/shardingsphere/commit/7847cd42019044901b996fde8e49ec0bb9f4e306?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7847cd4) will **decrease** coverage by `0.06%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #24099      +/-   ##
   ============================================
   - Coverage     50.17%   50.11%   -0.06%     
   - Complexity     1568     1572       +4     
   ============================================
     Files          3244     3253       +9     
     Lines         53184    53403     +219     
     Branches       9786     9822      +36     
   ============================================
   + Hits          26683    26764      +81     
   - Misses        24158    24279     +121     
   - Partials       2343     2360      +17     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...e/driver/jdbc/core/statement/StatementManager.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-amRiYy9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kcml2ZXIvamRiYy9jb3JlL3N0YXRlbWVudC9TdGF0ZW1lbnRNYW5hZ2VyLmphdmE=) | `88.88% <0.00%> (-5.56%)` | :arrow_down: |
   | [...istsql/ral/queryable/ShowDistVariableExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL3F1ZXJ5YWJsZS9TaG93RGlzdFZhcmlhYmxlRXhlY3V0b3IuamF2YQ==) | `64.28% <0.00%> (-29.84%)` | :arrow_down: |
   | [...ngsphere/infra/context/kernel/KernelProcessor.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5mcmEvY29udGV4dC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvY29udGV4dC9rZXJuZWwvS2VybmVsUHJvY2Vzc29yLmphdmE=) | `65.00% <0.00%> (-27.31%)` | :arrow_down: |
   | [...stsql/ral/queryable/ShowDistVariablesExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL3F1ZXJ5YWJsZS9TaG93RGlzdFZhcmlhYmxlc0V4ZWN1dG9yLmphdmE=) | `77.27% <0.00%> (-22.73%)` | :arrow_down: |
   | [.../distsql/ral/updatable/SetDistVariableHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL3VwZGF0YWJsZS9TZXREaXN0VmFyaWFibGVIYW5kbGVyLmphdmE=) | `72.91% <0.00%> (-18.26%)` | :arrow_down: |
   | [...hm/DataMatchDataConsistencyCalculateAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL2RhdGEtcGlwZWxpbmUvY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGF0YS9waXBlbGluZS9jb3JlL2NoZWNrL2NvbnNpc3RlbmN5L2FsZ29yaXRobS9EYXRhTWF0Y2hEYXRhQ29uc2lzdGVuY3lDYWxjdWxhdGVBbGdvcml0aG0uamF2YQ==) | `28.09% <0.00%> (-7.20%)` | :arrow_down: |
   | [...proxy/backend/config/ProxyConfigurationLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb25maWcvUHJveHlDb25maWd1cmF0aW9uTG9hZGVyLmphdmE=) | `54.54% <0.00%> (-2.06%)` | :arrow_down: |
   | [...shardingsphere/mode/metadata/MetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bW9kZS9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21ldGFkYXRhL01ldGFEYXRhQ29udGV4dHMuamF2YQ==) | `60.97% <0.00%> (ø)` | |
   | [...rdingsphere/proxy/config/LogbackConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9jb25maWcvTG9nYmFja0NvbmZpZ3VyYXRpb24uamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...le/metadata/reviser/SingleMetaDataReviseEntry.java](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL3NpbmdsZS9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaW5nbGUvbWV0YWRhdGEvcmV2aXNlci9TaW5nbGVNZXRhRGF0YVJldmlzZUVudHJ5LmphdmE=) | `100.00% <0.00%> (ø)` | |
   | ... and [60 more](https://codecov.io/gh/apache/shardingsphere/pull/24099?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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


[GitHub] [shardingsphere] TeslaCN merged pull request #24099: Fix statement cache not closed when connection is closed(#24070)

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN merged PR #24099:
URL: https://github.com/apache/shardingsphere/pull/24099


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


[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #24099: Fix statement cache not closed when connection is closed(#24070)

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #24099:
URL: https://github.com/apache/shardingsphere/pull/24099#discussion_r1102345826


##########
test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/commitrollback/MultiTransactionInConnectionTestCase.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.test.e2e.transaction.cases.commitrollback;
+
+import org.apache.shardingsphere.test.e2e.transaction.cases.base.BaseTransactionTestCase;
+import org.apache.shardingsphere.test.e2e.transaction.engine.base.TransactionBaseE2EIT;
+import org.apache.shardingsphere.test.e2e.transaction.engine.base.TransactionTestCase;
+
+import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+/**
+ * Multiple transactions within a connection integration test.
+ */
+@TransactionTestCase
+public final class MultiTransactionInConnectionTestCase extends BaseTransactionTestCase {
+    
+    public MultiTransactionInConnectionTestCase(final TransactionBaseE2EIT baseTransactionITCase, final DataSource dataSource) {
+        super(baseTransactionITCase, dataSource);
+    }
+    
+    @Override
+    public void executeTest() throws SQLException {
+        try (Connection connection = getDataSource().getConnection()) {
+            PreparedStatement statement = connection.prepareStatement("insert into account(id, balance, transaction_id) values(?, ?, ?)");
+            for (int i = 0; i < 8; i++) {
+                connection.setAutoCommit(false);
+                statement.setLong(1, i);
+                statement.setFloat(1, i);
+                statement.setInt(1, i);
+                statement.execute();
+                connection.commit();
+            }
+            assertAccountRowCount(connection, 8);
+        }
+    }
+    

Review Comment:
   Useless blank line.



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