我尝试从mysql-java-client
转到mariadb-java-client
。我使用HikariCP
池,我使用HikariCP网站提供的默认MySQL配置。
如果我使用默认的mysql客户端,工作正常,但使用mariadb我需要删除这个参数:
<!-- Works with both clients -->
<property name="hibernate.connection.provider_class">com.zaxxer.hikari.hibernate.HikariConnectionProvider</property>
<!-- Works with mysql-java-client, not with mariadb-java-client -->
<property name="hibernate.hikari.dataSource.cachePrepStmts">true</property>
<property name="hibernate.hikari.dataSource.prepStmtCacheSize">250</property>
<property name="hibernate.hikari.dataSource.prepStmtCacheSqlLimit">2048</property>
<property name="hibernate.hikari.dataSource.useServerPrepStmts">true</property>
我不知道是否需要指定这些参数或是可选的。