Skip to content
New issue

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

tomcat-jdbc check if returned connection is closed #235

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

panchenko
Copy link

@panchenko panchenko commented Jan 16, 2020

https://bz.apache.org/bugzilla/show_bug.cgi?id=64083

I had a situation when driver closed connection because of I/O error, bur connection has been added to the avaialble ones and then returned to another caller.
The testOn* properties were not enabled in that case.

It looks like the pool can easily check if connection has been closed and don't accept it back.
WDYT?

Copy link
Contributor

@ChristopherSchultz ChristopherSchultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this test-case actually tests the change. There is no check to see if the connection in the pool is not damaged, or a complaint if it is damaged.

@panchenko
Copy link
Author

panchenko commented Aug 28, 2021

The test checks that connection obtained from the pooll second time can be used for query execution.
Without this pool code change it returns the closed connection and query exection fails.

I agree the intent is not fully clear, as it tests it as black-box, I will check if some white-box asserts can be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants