You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lazy handling of early setClientInfo/setNetworkTimeout calls in LazyConnectionDataSourceProxy #37258
LazyConnectionDataSourceProxy is designed to defer the acquisition of a physical JDBC Connection until it is actually needed.
However, the current implementation does not respect this lazy contract for the following Connection methods:
setClientInfo(String, String)
setClientInfo(Properties)
setNetworkTimeout(Executor, int)
When any of these methods is invoked on the proxy connection before the physical connection has been materialized, the proxy immediately calls getTargetConnection() to obtain the underlying physical connection and then delegates the call to it. This prematurely triggers the acquisition of the actual JDBC Connection, defeating the purpose of lazy loading.
Is this behavior intentional design? If not, please assign this issue to me. I would be happy to submit a pull request to enhance it.
changed the title [-]Consistent handling of early setClientInfo/setNetworkTimeout calls in ` LazyConnectionDataSourceProxy`[/-][+]Lazy handling of early `setClientInfo`/`setNetworkTimeout` calls in ` LazyConnectionDataSourceProxy`[/+]on Sep 8, 2026
Is this behavior intentional design? If not, please assign this issue to me. I would be happy to submit a pull request to enhance it.
We determined that this is unintentional.
Thus, if you'd like to submit a PR, feel free to do so, but let us know in what time frame you expect you'd handle it, since we will otherwise address it ourselves.
Thanks! I already have a fix ready and will submit the PR within 24 hours (likely later today). Please hold off on working on it in the meantime. Thanks for your patience!
Activity
sbrannen commentedon Sep 8, 2026
Indeed, this looks like it might just be an oversight. We'll discuss this within the team and post back here.
See related issues:
[-]Consistent handling of early setClientInfo/setNetworkTimeout calls in ` LazyConnectionDataSourceProxy`[/-][+]Lazy handling of early `setClientInfo`/`setNetworkTimeout` calls in ` LazyConnectionDataSourceProxy`[/+]sbrannen commentedon Sep 8, 2026
We determined that this is unintentional.
Thus, if you'd like to submit a PR, feel free to do so, but let us know in what time frame you expect you'd handle it, since we will otherwise address it ourselves.
Cheers
guanchengang commentedon Sep 9, 2026
Thanks! I already have a fix ready and will submit the PR within 24 hours (likely later today). Please hold off on working on it in the meantime. Thanks for your patience!
sbrannen commentedon Sep 9, 2026
Superseded by:
Lazy handling of early setClientInfo/setNetworkTimeout calls in LazyC…
Add the omitted this
Use Mockito instead of custom MockConnection
Fix typo
Lazily handle setClientInfo/setNetworkTimeout in LazyConnectionDataSo…