Hmmm, let's see. The function getNextIndex() is public, potentially leading to all sorts of indexing fun, depending upon when and how it's called elsewhere. Most importantly, a connected connection is returned from getConnectedConnection(). Depending upon the size of your pool, the number of times it's called, and for how long the connection is used by the caller, the same connection can get returned to multiple callers. Debugging fun!