Connection has already been closed
时间: 2024-04-25 15:23:27 浏览: 233
根据引用\[1\]中的日志检索结果,发现异常情况都与连接已关闭有关。在调用存储过程之前,存在一个websock调用抛出了java.net.SocketTimeoutException: Read timed out异常。根据引用\[2\]的代码,可以看出在设置自动提交之前需要判断连接是否关闭,如果没有关闭才执行操作。而引用\[3\]中的代码是一个简单的没有框架的例子,涉及到事务处理时,使用了长连接将连接传递到事务结束。在数据库查重过程中,出现了Connection has already been closed的异常。根据报错日志,可以看出是在数据库查重的catch块中出现了该异常。因此,问题的原因是连接已经被关闭了。
#### 引用[.reference_title]
- *1* [记一次Connection has already been closed问题排查](https://blog.csdn.net/u012839245/article/details/104747016)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [java.sql.SQLException: Connection has already been closed.](https://blog.csdn.net/wangjie919/article/details/80738426)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [一直在使用中的生产上的程序中突然抛出异常“Connection has already been closed.”](https://blog.csdn.net/qq_37358143/article/details/94597129)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文