Skip to content

Lazy handling of early setClientInfo/setNetworkTimeout calls in LazyConnectionDataSourceProxy #37258

Closed as not planned

Description

@guanchengang

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.

Activity

  1. added
    status: waiting-for-triage
    on Sep 8, 2026
  2. added
    in: data
    on Sep 8, 2026
  3. sbrannen commented on Sep 8, 2026

    @sbrannen
    Member

    Indeed, this looks like it might just be an oversight. We'll discuss this within the team and post back here.

    See related issues:

  4. added
    type: enhancement
    and removed
    status: waiting-for-triage
    on Sep 8, 2026
  5. 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
  6. self-assigned this
    on Sep 8, 2026
  7. sbrannen commented on Sep 8, 2026

    @sbrannen
    Member

    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.

    Cheers

  8. added this to the 7.0.10 milestone on Sep 8, 2026
  9. guanchengang commented on Sep 9, 2026

    @guanchengang
    ContributorAuthor

    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!

  10. removed this from the 7.0.10 milestone on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: datatype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions