Closed
Description
Spring Boot 2.1 exposes a property spring.data.jpa.repositories.bootstrap-mode
that can be set to default
(default) deferred
or lazy
. I suggest do change the default value for property to be changed in the following scenarios:
- Change the general default to
deferred
– it parallelizes the bootstrap of theEntityManagerFactory
and delays repository initialization to the end of theApplicationContext
initialization. I.e. there are performance benefits to the startup but the app is the same state as with the current default once it has been started. - Default to
lazy
for@SpringBootTest
,@DataJpaTest
– this leaves all but repositories injected into the tests initialized which gives a bit of a performance boost in both scenarios.