Issue 1:
Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Searched open and closed GitHub issues.

Read documentation: ShardingSphere Doc.

Please pay attention on issues you submitted, because we maybe need more details.

If no response more than 7 days and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

4.0.0-RC3-SNAPSHOT

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-Proxy

Expected behavior

Transaction terminate correctly.

Actual behavior

[WARN ] 13:56:35.511 [ShardingSphere-Command-7] o.a.s.s.b.c.j.c.BackendConnection - Current transaction have not terminated, retry count:[3].

[WARN ] 13:56:35.712 [ShardingSphere-Command-7] o.a.s.s.b.c.j.c.BackendConnection - Current transaction have not terminated, retry count:[4].

[WARN ] 13:56:35.912 [ShardingSphere-Command-7] o.a.s.s.b.c.j.c.BackendConnection - Current transaction have not terminated, retry count:[5].

[ERROR] 13:56:35.912 [ShardingSphere-Command-7] o.a.s.s.b.c.j.c.BackendConnection - Cannot do switch, exceed maximum retry count:[5].

[ERROR] 13:56:35.912 [ShardingSphere-Command-7] o.a.s.s.f.c.CommandExecutorTask - Exception occur:

org.apache.shardingsphere.core.exception.ShardingException: Failed to switch schema, please terminate current transaction.

at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.connection.BackendConnection.setCurrentSchema(BackendConnection.java:107)

at org.apache.shardingsphere.shardingproxy.backend.text.admin.BroadcastBackendHandler.execute(BroadcastBackendHandler.java:53)

at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:72)

at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:86)

at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:66)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Reason analyze (If you can)

This pr(https://github.com/apache/incubator-shardingsphere/pull/2119/files) add setCurrentSchema() which will throw exception when a transaction is not terminated.

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

Issue 2:
For English only, other languages we will close it directly.

Please answer these questions before submitting your issue. Thanks!

Which version of Sharding-Sphere do you using?

Which project do you using? Sharding-JDBC or Sharding-Proxy?

Expected behavior

Actual behavior

Reason analyze

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc

For bug report, please MUST provide the reproduce example codes (such as a github link).