今天使用上述组合 做项目。。

在做一个需要较长时间使用数据库的 请求时,项目日志没有任何报错,但是数据库也没有插入代码。

初步猜测是 数据库连接超过 removeAbandonedTimeout 时间导致数据库连接被强制回收,但是为什么没有报错呢(由于开发环境数据较少,没有这个现象,

但是生产环境数据较多,当时数据也没插入成功,日志也没报错,一脸懵)。。

没办法,只有在开发模拟数据,然后跟踪代码,超时时间到后,会走到这么一段代码:

try {
// This is an around advice: Invoke the next interceptor in the chain.
// This will normally result in a target object being invoked.
retVal = invocation.proceedWithInvocation();
}
catch (Throwable ex) {
// target invocation exception
completeTransactionAfterThrowing(txInfo, ex);
throw ex;
}
finally {
cleanupTransactionInfo(txInfo);
}

进入 catch 中 执行

completeTransactionAfterThrowing(txInfo, ex); (看方法名:事务完成后抛出错误)
if (txInfo != null && txInfo.hasTransaction()) {
if (logger.isTraceEnabled()) {
logger.trace("Completing transaction for [" + txInfo.getJoinpointIdentification() +
"] after exception: " + ex);
} // 这个ex 就是我们要的错误信息,但是这里的日志级别却是 trace ,无语啊。。我<logger name="org.springframework" level="error"/>是error ,,好吧,日志是打印不出来。。靠
if (txInfo.transactionAttribute.rollbackOn(ex)) { 
  
  try { txInfo.getTransactionManager().rollback(txInfo.getTransactionStatus()); } catch (TransactionSystemException ex2) {
logger.error("Application exception overridden by rollback exception", ex); ex2.initApplicationException(ex); throw ex2;
}

最新文章

  1. Web 前端之HTML和CSS
  2. 扩展htmlhelper.DropDownListFor 支持list数据源和option增加属性
  3. iOS7上的地图定位接口BUG
  4. Flask 备注一(单元测试,Debugger, Logger)
  5. lightbox图片展示效果
  6. diff &amp; pattch 命令
  7. paper 113:Bhattacharyya distance
  8. 解决Ubuntu和Windows的文件乱码问题(转载)
  9. symfony2 关于是否需要建立多bundle
  10. 依赖和用jar包得区别
  11. 什么是BSD?
  12. unity案例入门(一)(拾取游戏)
  13. 286万QPS!腾讯云TDSQL打造数据库领域的“超音速战机”
  14. 『2019/3/19 USACO测试 反思与总结』
  15. Android实现两次点击返回键提示退出
  16. BZOJ3996[TJOI2015]线性代数——最小割
  17. Python-多线程.md
  18. Cracking The Coding Interview 4.0_二叉树
  19. Web Service(一):初识
  20. 【FastDFS】FastDFS在CentOS的搭建

热门文章

  1. phpcms基础循环
  2. globals和locals的区别
  3. 学习 MeteoInfo二次开发教程(四)
  4. nodejs server websocket
  5. How to solve “Dynamic Web Module 3.1 requires Java 1.7 or newer” in Eclipse
  6. JavaScript学习-2循环
  7. javascript:控制台详解
  8. css:清楚html所有标签自带属性
  9. 把post请求的地址粘贴到浏览器地址栏敲回车报错405[Method Not Allowed]
  10. MFC之sqlite