<p dir="auto">因为采用dbproxy中间件，由dbproxy维持到mysql的connection。为了复用连接，不支持autocommit=0的方式开启事务，只能显式执行begin来开启事务。<br>
但是sharding-jdbc没有实现begin或start transaction的MySQLParser。</p>
<h3 dir="auto">Which version of Sharding-Jdbc do you using?（您使用的Sharding-Jdbc版本为？）</h3>
<p dir="auto">1.5.4.1</p>
<h3 dir="auto">Expected behavior （您预期的结果是）</h3>
<p dir="auto">可以正常执行statement.executeUpdate("BEGIN");</p>
<h3 dir="auto">Actual behavior （实际运行的结果是）</h3>
<p dir="auto">报异常com.dangdang.ddframe.rdb.sharding.parsing.parser.exception.SQLParsingUnsupportedException: Not supported token 'BEGIN'.</p>
<h3 dir="auto">Steps to reproduce the behavior （可重现问题的操作步骤）</h3>
<p dir="auto">执行statement.executeUpdate("BEGIN");</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;bean:properties id=&quot;keyGeneratorProps&quot;&gt;
    &lt;prop key=&quot;worker.id&quot;&gt;?&lt;/prop&gt;
&lt;/bean:properties&gt;
&lt;sharding:key-generator id=&quot;xxKeyGenerator&quot; type=&quot;SNOWFLAKE&quot; column=&quot;id&quot; props-ref=&quot;keyGeneratorProps&quot;/&gt;"><pre class="notranslate"><code class="notranslate">&lt;bean:properties id="keyGeneratorProps"&gt;
    &lt;prop key="worker.id"&gt;?&lt;/prop&gt;
&lt;/bean:properties&gt;
&lt;sharding:key-generator id="xxKeyGenerator" type="SNOWFLAKE" column="id" props-ref="keyGeneratorProps"/&gt;
</code></pre></div>