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

5.0.1-SNAPSHOT

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

ShardingSphere-Proxy

Expected behavior

execute XA transaction

Actual behavior

when test by sysbech read_write for proxy-myqsl XA mode, got following errrors:

Initializing worker threads...

Threads started!

FATAL: mysql_stmt_execute() returned error 1399 (XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state) for query 'COMMIT'
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:409: SQL error, errno = 1399, state = 'XAE07': XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
FATAL: mysql_stmt_execute() returned error 1399 (XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state) for query 'COMMIT'
(last message repeated 1 times)
FATAL: mysql_stmt_execute() returned error 1399 (XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state) for query 'COMMIT'
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:409: SQL error, errno = 1399, state = 'XAE07': XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:409: SQL error, errno = 1399, state = 'XAE07': XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
(last message repeated 1 times)
FATAL: mysql_stmt_execute() returned error 1399 (XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state) for query 'COMMIT'
(last message repeated 1 times)
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:409: SQL error, errno = 1399, state = 'XAE07': XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
(last message repeated 1 times)
FATAL: mysql_stmt_execute() returned error 1399 (XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state) for query 'COMMIT'
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:409: SQL error, errno = 1399, state = 'XAE07': XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state

Reason analyze (If you can)

maybe same as #9611

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

start a proxy with sharding mode and XA mode for mysql

execute following sysbench script:

sysbench oltp_read_write --mysql-host=10.16.9.234 --mysql-port=3307 --mysql-user=root --mysql-password='root' --mysql-db=sbtest --tables=1 --table-size=1 --report-interval=5 --time=180 --threads=100 --max-requests=0 --percentile=99 --range_selects=off --rand-type=uniform --auto_inc=off run | tee transanction.XA.tx

Issue 2:
Hello, The shardingsphere version I am using is 5.0.0，the following is my code and result data, please look at the reason：

Test code:

object SnowFlakeUtils {

fun getId(workerId: String): Long {

val keyGenerator = SnowflakeKeyGenerateAlgorithm()

val properties = Properties()

properties.setProperty("worker-id", workerId)

keyGenerator.props = properties

keyGenerator.init()

return keyGenerator.generateKey().toString().toLong()

}

}

for (i in 1..100) {

println(SnowFlakeUtils.getId("1"))

}

The resulting data is:

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630224842752

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630229037056

725026630233231360