WebApp (Tomcat-jdbc) Pooled DB connection throwing abandon exception

前端 未结 8 2015
被撕碎了的回忆
被撕碎了的回忆 2020-12-08 08:18

I have been browsing SO for some time, and chewing my hat in the process, but cannot find an exact match to my problem.
For short, I am getting superb stack trace (org.a

相关标签:
8条回答
  • 2020-12-08 08:53

    I can see this thread is old, but I had a similar problem, and I eventually found the reason that caused it, so I would like to share if it can help someone:

    I used the connection from a restful web-service. In the interface at the serverside handling request from the client, I had accidentially put 'throws IOException' in the method signature:

    @GET
    @Path("/databases")
    @Produces(MediaType.APPLICATION_JSON)
    public String getAllDatabases() throws IOException {
    
    0 讨论(0)
  • 2020-12-08 08:57

    If you define your datasource in the context.xml of tomcat then you should add the ResetAbandonedTimer like below :

    jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
    

    After setting ResetAbandonedTimer, issue got resolved in my application, Requesting you to let me know is there any relation between ResetAbandonedTimer interceptor and removeAbandoned="true" removeAbandonedTimeout="60"

    0 讨论(0)
提交回复
热议问题