我有简单的spring + hibernate + mysql项目。打开mysql服务器上的查询日志,我看到很多频繁的“SET autocommit = 0; commit; SET autocommit = 0”语句而没有在我的应用程序上执行任何操作。
我的应用程序的哪个进程/为什么执行这些频繁的查询?我列出了连接池配置。
请注意:
如果我取消部署我的应用程序所有这些“SET autocommit = 0; commit; SET autocommit = 0“日志将停止
131001 10:41:31 2046查询SET autocommit = 0 2046查询提交 2046 Query SET autocommit = 1 2046 Query SET autocommit = 0 2046查询提交 2046 Query SET autocommit = 1 2046 Query SET autocommit = 0 2046查询提交 2046 Query SET autocommit = 1 2061查询SET autocommit = 0 2061查询提交 2061查询SET autocommit = 1 2061查询SET autocommit = 0 2061查询提交 2061查询SET autocommit = 1 2061查询SET autocommit = 0 2061查询提交 2061查询SET autocommit = 1 131001 10:41:34 2051查询SET autocommit = 0 2051查询提交 2051查询SET autocommit = 1 2051查询SET autocommit = 0 2051查询提交 2051查询SET autocommit = 1 2051查询SET autocommit = 0 2051查询提交 2051查询SET autocommit = 1 2047 Query SET autocommit = 0
<bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="" />
<property name="username" value="..."/>
<property name="password" value="..."/>
<property name="idleConnectionTestPeriodInMinutes" value="60"/>
<property name="idleMaxAgeInMinutes" value="240"/>
<property name="maxConnectionsPerPartition" value="30"/>
<property name="minConnectionsPerPartition" value="5"/>
<property name="partitionCount" value="3"/>
<property name="acquireIncrement" value="5"/>
<property name="statementsCacheSize" value="300"/>
<property name="releaseHelperThreads" value="3"/>
<property name="connectionTestStatement" value="/* ping *\/ SELECT 8"/>
</bean>
答案 0 :(得分:1)