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 10, 2024
1 parent b328d58 commit 00a940d
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 @@ -506,8 +506,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].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,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 00a940d

Please sign in to comment.