连接mysql数据库,时不时出现这个问题,必须手工重启服务器才能解决!都是update和insert报错!com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/tianyaclub/entity/travel_voteoper_record_SqlMap.xml.
--- The error occurred while applying a parameter map.
--- Check the VoteoperRecord.insert-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: INSERT command denied to user 'tmydb'@'192.1.169.2' for table 'travel_voteoper_record'
--- The error occurred in com/tianyaclub/entity/travel_voteoper_record_SqlMap.xml.
--- The error occurred while applying a parameter map.
--- Check the VoteoperRecord.insert-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: INSERT command denied to user 'tmydb'@'192.1.169.2' for table 'travel_voteoper_record'
不知道是不是连接池配置有问题
<settings cacheModelsEnabled="true" enhancementEnabled="true"
lazyLoadingEnabled="true" maxRequests="256" maxSessions="64"
errorTracingEnabled="true"
maxTransactions="16" useStatementNamespaces="true" />
<transactionManager type ="JDBC" commitRequired="true">
<dataSource type ="cn.tianya.server.DBConnection.ProxoolDataSourceFactory" >
<property name ="alias" value="mysqlDs"/>
<property name ="driver" value ="com.p6spy.engine.spy.P6SpyDriver" /><!-- com.mysql.jdbc.Driver -->
<property name ="driverUrl" value ="jdbc:mysql://localhost/tianyaclub3?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull" />
<property name ="user" value ="root" />
<property name ="password" value ="" />
<property name ="maximumNewConnections" value="10"></property>
<property name ="houseKeepingTestSql" value="select CURRENT_DATE"></property>
<property name ="houseKeepingSleepTime" value="400000"></property>
<property name ="loginTimeout" value="0"></property>
<property name ="maximumActiveTime" value="60000"></property>
<property name ="minimumConnectionCount" value="10"></property>
<property name ="maximumConnectionCount" value="50"></property>
<property name ="maximumConnectionLifetime" value="18000000"></property>
<property name ="maximum-active-time" value="3600000"></property>
<property name ="testAfterUse" value="true"></property>
<property name ="testBeforeUse" value="true"></property>
<property name ="trace" value="true"></property>
<property name ="prototypeCount" value="5"></property>
</dataSource> </transactionManager>
要么就是表被锁住了。
你最好检查一下你的服务器。造成这种现象问题多出在你的服务器上。