Menu

#36 Closed connections not handled in ConnectionPool

v2.0
closed-fixed
nobody
5
2006-12-12
2005-04-25
No

After a long period of inactivity sql connections are
closed by the jdbc driver and/or the database.
Depending of the error, all bad connections can be
marked as used and kept in the pool. As a result cofax
always get a timeout on getConnection and displays a
blank screen.

if a sql exception happens, everything is ok : connection
is dropped and the connection pool is rebuild.

But if connection.isClosed is true, the connection is not
dropped and marked as used. This happens with all the
connections, and the connectionpool is filled by bad
connections. getConnection always return null.

Fix :
org.cofax.connectionpool.ConnectionPool :
isConnected

replace :

}else{
logWriter.log("ERR: Connection was already closed!",
LogWriter.ERROR) ;
return false;
}

by :
}else{
logWriter.log("ERR: Connection was already closed!",
LogWriter.ERROR) ;
throw new SQLException( "Connection was already
closed!");
}

Discussion

  • F.X. Robin

    F.X. Robin - 2006-12-12
    • status: open --> closed-fixed
     
  • F.X. Robin

    F.X. Robin - 2006-12-12

    Logged In: YES
    user_id=1283696
    Originator: NO

    fix already in code.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.