Skip to content

Commit

Permalink
Update Hibernate ORM's "active" documentation
Browse files Browse the repository at this point in the history
For consistency with datasource documentation.
  • Loading branch information
yrodiere committed Oct 1, 2024
1 parent f30e398 commit 4eb39f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions docs/src/main/asciidoc/hibernate-orm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,10 @@ by default it is active at runtime,
that is Quarkus will start the corresponding Hibernate ORM `SessionFactory` on application startup.

To deactivate a persistence unit at runtime, set `quarkus.hibernate-orm[.optional name].active` to `false`.
Then Quarkus will not start the corresponding Hibernate ORM `SessionFactory` on application startup.
Any attempt to use the corresponding persistence unit at runtime will fail with a clear error message.
If a persistence unit is not active:

* The `SessionFactory` will not start during application startup.
* Accessing the `EntityManagerFactory`/`EntityManager` or `SessionFactory`/`Session` will cause an exception to be thrown.

This is in particular useful when you want an application to be able
to xref:datasource.adoc#datasource-active[use one of a pre-determined set of datasources at runtime].

Check warning on line 506 in docs/src/main/asciidoc/hibernate-orm.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using 'because' or 'while' rather than 'as'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using 'because' or 'while' rather than 'as'.", "location": {"path": "docs/src/main/asciidoc/hibernate-orm.adoc", "range": {"start": {"line": 506, "column": 12}}}, "severity": "INFO"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ public interface HibernateOrmRuntimeConfigPersistenceUnit {
*
* See xref:hibernate-orm.adoc#persistence-unit-active[this section of the documentation].
*
* If the persistence unit is not active, it won't start with the application,
* and accessing the corresponding EntityManagerFactory/EntityManager or SessionFactory/Session
* will not be possible.
*
* Note that if Hibernate ORM is disabled (i.e. `quarkus.hibernate-orm.enabled` is set to `false`),
* all persistence units are deactivated, and setting this property to `true` will fail.
*
Expand Down

0 comments on commit 4eb39f6

Please sign in to comment.