jt-20180528 / pro_document_mycat

项目文档记录,一些技术栈预研文档
2 stars 1 forks source link

mycat1.6.5集成过程中出现不发检查事务提交模式问题 #19

Open lujunGit opened 5 years ago

lujunGit commented 5 years ago

ERROR com.alibaba.dubbo.rpc.filter.ExceptionFilter - [DUBBO] Got unchecked and undeclared exception which called by 192.168.0.183. service: com.hitler.service.tenant.ITenantService, method: findByGameId, exception: org.springframework.orm.jpa.JpaSystemException: could not inspect JDBC autocommit mode; nested exception is org.hibernate.exception.GenericJDBCException: could not inspect JDBC autocommit mode, dubbo version: 2.5.8, current host: 192.168.0.183 org.springframework.orm.jpa.JpaSystemException: could not inspect JDBC autocommit mode; nested exception is org.hibernate.exception.GenericJDBCException: could not inspect JDBC autocommit mode

lujunGit commented 5 years ago

百度上说是因为,配置了druid数据库连接池定时关闭数据连接对象,从代码上看,很多引发这个错误的代码方法是注单,在进行支付扣减的时候使用的是多线程的方式,而关闭jdbc连接的时间是5分钟但是,异步处理大于5分钟,故而异步线程中的逻辑出了错,但是连接对象已经关闭了,这时出错再出发回滚,则报连接对象不存在,无法检查自动提交事务的错误。

解决办法: 调大durid自动关闭连接对象的时间