Skip to content

Commit ab785d9

Browse files
committed
Document limitations of using deferred JPA bootstrap
Closes gh-24027
1 parent 0fb4825 commit ab785d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3893,7 +3893,13 @@ To enable deferred or lazy bootstrapping, set the configprop:spring.data.jpa.rep
38933893
When using deferred or lazy bootstrapping, the auto-configured `EntityManagerFactoryBuilder` will use the context's `AsyncTaskExecutor`, if any, as the bootstrap executor.
38943894
If more than one exists, the one named `applicationTaskExecutor` will be used.
38953895

3896-
NOTE: When using deferred or lazy bootstraping, make sure to defer any access to the JPA infrastructure after the application context bootstrap phase.
3896+
[NOTE]
3897+
====
3898+
When using deferred or lazy bootstraping, make sure to defer any access to the JPA infrastructure after the application context bootstrap phase.
3899+
You can use `SmartInitializingSingleton` to invoke any initialization that requires the JPA infrastructure.
3900+
For JPA components (such as converters) that are created as Spring beans, use `ObjectProvider` to delay the resolution of dependencies, if any.
3901+
====
3902+
38973903

38983904
TIP: We have barely scratched the surface of Spring Data JPA.
38993905
For complete details, see the {spring-data-jdbc-docs}[Spring Data JPA reference documentation].

0 commit comments

Comments
 (0)