I recently inherited some code in which I found that a JDBC connection is initialized in a filter and an HttpSession is added for each user. This connection is then reused in various parts of the web application for the user. It immediately seemed to me the smell of code. I would like to return to the developer who wrote it and explained why he should not do this ... But maybe I'm not so confident in myself ...
Besides using extra storage space and potentially limiting available database connections, are there other reasons why you won’t keep the JDBC connection in the session?
source
share