We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I close DB connection multiple times
it's totally fine. The first close() call closes the connection, and the following close() calls are just ignored.
close()
pool.available
pool.getConnection()
class PooledDataSourceTest { @Test fun `close same connection multiple times`() { val conn = pool.connection expect(pool.used.keys).toHaveSize(1) expect(pool.available).toHaveSize(0) conn.close() conn.close() conn.close() expect(pool.used.keys).toHaveSize(0) expect(pool.available).toHaveSize(1) // Fails: pool.available.size is 3 val conn2 = pool.connection expect(pool.connection).notToEqual(conn2) // Fails: it's the same connection expect(pool.connection).notToEqual(conn2) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Case:
I close DB connection multiple times
Expected result:
it's totally fine. The first
close()
call closes the connection, and the followingclose()
calls are just ignored.Actual result:
pool.available
multiple times.pool.getConnection()
return the same connection multiple times.Failing test:
The text was updated successfully, but these errors were encountered: