Recently one of our legacy applications was changed from a non-pooling data source to one that pools. Immediately connection leaks started. This made me realize that
Java was garbage collecting the unclosed connections when the non-pooling data source was being used. With the pool calling close() on a connection was required to move it back to the pool. If close() was not called the connection was leaked, i.e. never usable again but also never garbage collected.
This has me asking myself what is a connection in physical terms? Is a connection just an object so a connection leak is a memory leak? Or does a connection encapsulate some other finite resource that can be used up faster than available memory can be used up.
I've been using Connection for years and never really thought about this.
-=beeky