Skip to content

Considered new defaults for JPA repository bootstrap #16230

Closed
@odrotbohm

Description

@odrotbohm

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 the EntityManagerFactory and delays repository initialization to the end of the ApplicationContext 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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions