Skip to content

Commit 3556595

Browse files
Clarify that injecting Instance<MyBean> won't fail startup if MyBean is inactive
Only actually attempting to retrieve the bean instance will trigger a failure. Co-Authored-By: marko-bekhta <[email protected]>
1 parent 6175360 commit 3556595

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/src/main/asciidoc/datasource.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ If a datasource is not active:
450450
* The datasource does not attempt to connect to the database during application startup.
451451
* The datasource does not contribute a <<datasource-health-check,health check>>.
452452
* Static CDI injection points involving the datasource, such as `@Inject DataSource ds` or `@Inject Pool pool`, cause application startup to fail.
453-
* Dynamic retrieval of the datasource, such as through `CDI.getBeanContainer()`, `Arc.instance()`, or by injecting an `Instance<DataSource>`, causes an exception to be thrown.
453+
* Dynamic retrieval of the datasource, such as through `CDI.getBeanContainer()`, `Arc.instance()`, or an injected `Instance<DataSource>`, causes an exception to be thrown.
454454
* Other Quarkus extensions that consume the datasource may cause application startup to fail.
455455
+
456456
In this case, you must also deactivate those other extensions.

docs/src/main/asciidoc/hibernate-orm.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ If a persistence unit is not active:
552552

553553
* The `SessionFactory` does not start during application startup.
554554
* Static CDI injection points involving the persistence unit, such as `@Inject SessionFactory sf` or `@Inject Session session`, cause application startup to fail.
555-
* Dynamic retrieval of the persistence unit, such as through `CDI.getBeanContainer()`, `Arc.instance()`, or by injecting an `Instance<Session>`, causes an exception to be thrown.
555+
* Dynamic retrieval of the persistence unit, such as through `CDI.getBeanContainer()`, `Arc.instance()`, or an injected `Instance<Session>`, causes an exception to be thrown.
556556
* Other Quarkus extensions that consume the persistence unit may cause application startup to fail.
557557
+
558558
In this case, you must also deactivate those other extensions.

0 commit comments

Comments
 (0)