Skip to content

Avoid eager checkDefaultConnectionProperties call in LazyConnectionDataSourceProxy #29931

Closed
@reda-alaoui

Description

@reda-alaoui

Affects: 6.0.2

On afterPropertiesSet, LazyConnectionDataSourceProxy opens a connection to determine defaultAutoCommit and defaultTransactionIsolation. In case of exception, the latter is trapped, leading LazyConnectionDataSourceProxy to determine those properties when the connection is effectively requested by a consumer.

We use TestContainer to test our database interactions. The database startup takes a few seconds. To reduce test startup time, we start the database in a separate thread while the Spring context is initializing. LazyConnectionDataSourceProxy#checkDefaultConnectionProperties is the first consumer that makes the Spring Context initialization wait on the database startup thread.

It would be nice to have an option allowing to disable this eager check.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions