ДРУГ ВЪЗМОЖЕН ОТГОВОР
Ако забележите, свойствата, които задавате в xml за драйвера, също са общи свойства, зададени и предадени на jdbc. Така че не бих се изненадал, ако MyBatis просто ги вземаше и ги предаваше направо на драйвера. Така че може би опитайте това:
<environments default="development">
<environment id="development">
<transactionManager type="JDBC" />
<dataSource type="POOLED">
<!-- Just use ReplicationDriver -->
<property name="driver" value="com.mysql.jdbc.ReplicationDriver" />
<property name="url"
value="jdbc:mysql://localhost:3306/database" />
<property name="autoReconnect" value="true" />
<property name="roundRobinLoadBalance" value="true" />
<property name="username" value="root" />
<property name="password" value="" />
</dataSource>
</environment>
<environment id="production">
<transactionManager type="JDBC" />
<dataSource type="POOLED">
<!-- Just use ReplicationDriver -->
<property name="driver" value="com.mysql.jdbc.ReplicationDriver" />
<property name="url"
value="jdbc:mysql://xxx:3306/database" />
<property name="autoReconnect" value="true" />
<property name="roundRobinLoadBalance" value="true" />
<property name="username" value="production" />
<property name="password" value="" />
</dataSource>
</environment>
</environments>