Skip to content

Commit 58d890d

Browse files
committed
[hibernate#950] Update documentation example with openSession
1 parent d1d3f88 commit 58d890d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

documentation/src/main/asciidoc/reference/introduction.adoc

+9-7
Original file line numberDiff line numberDiff line change
@@ -670,12 +670,14 @@ the session when you're done.
670670

671671
[source, JAVA, indent=0]
672672
----
673-
Session session = sessionFactory.openSession();
674-
session.find(Book.class, id)
675-
.invoke(
676-
book -> ... //do something with the book
677-
)
678-
.eventually(session::close);
673+
Uni<Session> sessionUni = sessionFactory.openSession();
674+
sessionUni.chain(
675+
session -> session.find(Book.class, id)
676+
.invoke(
677+
book -> ... //do something with the book
678+
)
679+
.eventually(session::close)
680+
);
679681
----
680682

681683
=== Using the reactive session
@@ -1281,4 +1283,4 @@ or `withTransaction()`.
12811283

12821284
Hibernate Reactive is now integrated in {Quarkus}[Quarkus] and {Panache}[Panache].
12831285
Configuration works slightly differently in Quarkus, so be sure to check the Quarkus
1284-
documentation for details.
1286+
documentation for details.

0 commit comments

Comments
 (0)