Repository navigation
Fix JDBC timeout handling and pooled state restoration - #561
Merged
garydgregory merged 9 commits intoNov 23, 2026
Merged
Conversation
Centralize Duration conversion to JDBC seconds, preserving positive sub-second timeouts, capping oversized values, and retaining negative values for driver validation. Close statements when timeout setup fails. Restore original query timeouts when returning pooled prepared and callable statements. Discard statements if restoration fails and clear saved timeout state when replacing delegates. Apply configured login timeouts to physical connection attempts with provider-scoped coordination, bounded waits, and failure cleanup. Restore provider settings afterwards and preserve live configuration across deserialization. Preserve DriverAdapterCPDS eviction durations through JNDI References, preferring Duration properties and accepting legacy long millisecond values. Undeprecate DelegatingConnection.isValid(int) while preserving existing overload dispatch. Update Javadoc and release notes. Add regression coverage for timeout boundaries, statement reuse, failure paths, JNDI, serialization, and concurrent provider access.
AbstractConnectionFactory.loginTimeoutSupplier final
AbstractConnectionFactory.maxConnDuration final
implements javax.sql.CommonDataSource.setLoginTimeout(int)
Work around Duration.parse() losing the sign of negative-zero seconds components when restoring DriverAdapterCPDS JNDI References. Normalize the seconds component before parsing and compensate for the adjustment, respecting the duration's leading sign. Preserve existing ISO-8601 output and extreme duration values. Add regression coverage for mixed signs, minute/hour boundaries, malformed input, and legacy-property precedence. Update release notes.
Share live login timeout configuration only when deserialization reuses a registered data source. Otherwise, retain the serialized local setting, including the distinction between an unset timeout and explicit zero. Add regression coverage for repeated serialization, timeout boundaries, direct and JNDI providers, and registered sources before pool initialization. Extract common test setup and serialization helpers. Complete Javadoc for timeout methods and tests. Add @SInCE 2.15.0 to new public and protected API methods, and update release notes.
Allow closePool(null) to close a pool using default credentials when its configured user name is also null. Preserve matching behavior for non-null user names. Document null matching and add regression coverage for matching, mismatching, and null user names, including idle connection cleanup.
Use Objects.equals for both password comparisons in InstanceKeyDataSource.getConnection. Accept matching null passwords during retries after a password change. Add regression coverage for both pool types, including changes to and from null and rejection of incorrect passwords. Document null-password equality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix JDBC timeout handling and pooled state restoration
Centralize Duration conversion to JDBC seconds, preserving positive sub-second timeouts, capping oversized values, and retaining negative values for driver validation. Close statements when timeout setup fails.
Restore original query timeouts when returning pooled prepared and callable statements. Discard statements if restoration fails and clear saved timeout state when replacing delegates.
Apply configured login timeouts to physical connection attempts with provider-scoped coordination, bounded waits, and failure cleanup. Restore provider settings afterwards and preserve live configuration across deserialization.
Preserve DriverAdapterCPDS eviction durations through JNDI References, preferring Duration properties and accepting legacy long millisecond values.
Undeprecate DelegatingConnection.isValid(int) while preserving existing overload dispatch.
Update Javadoc and release notes. Add regression coverage for timeout boundaries, statement reuse, failure paths, JNDI, serialization, and concurrent provider access.
Assisted-By: OpenAI Codex
mvn; that'smvnon the command line by itself.