Description
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
.