Skip to content

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

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

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

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions