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

Implement timeout support for Connection.isValid(int) #685

Closed
mrotteveel opened this issue Jan 6, 2022 · 1 comment
Closed

Implement timeout support for Connection.isValid(int) #685

mrotteveel opened this issue Jan 6, 2022 · 1 comment

Comments

@mrotteveel
Copy link
Member

When Connection.isValid(int) was implemented in #176, it was implemented without timeout support. At some point, we also implemented registering a warning when a non-zero value was supplied. This is not an optimal solution (e.g. see this).

Although timeouts aren't possible with native/embedded, we could support it for pure-java with temporarily changing the blocking read timeout, and for native/embedded we could maybe use a CompletableFuture or something.

@mrotteveel
Copy link
Member Author

Implemented.

For Jaybird 4.0.6, the timeout is used as a network timeout. This only works for pure Java connections. In addition, for Jaybird 5, the check is performed asynchronously, using the timeout as the deadline of the async check, which makes the timeout also applicable to native connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment