Skip to content

Commit f9d0cfc

Browse files
authored
Merge pull request #49695 from beikov/patch-6
[#39321] Mention the proxy nature and transaction scoping in the Hibernate ORM CDI integration chapter
2 parents 3d44c27 + 91cbaf9 commit f9d0cfc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,13 @@ EntityManager entityManager;
486486
----
487487
<1> Here again, we use the same `@io.quarkus.hibernate.orm.PersistenceUnit` annotation.
488488

489+
[NOTE]
490+
====
491+
The injected `EntityManager` or `Session` instance is a proxy that requires an active transaction for interaction.
492+
493+
By default it is also possible to use it for read-only operations without a transaction when in a request scope, but this can be disabled by setting `quarkus.hibernate-orm.request-scoped.enabled` to `false`.
494+
====
495+
489496
You can inject the `EntityManagerFactory` of a named persistence unit using the exact same mechanism:
490497

491498
[source,java]

0 commit comments

Comments
 (0)