Skip to content

Commit 89fee1c

Browse files
committed
add CAUTION to doc
1 parent a294048 commit 89fee1c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@ The persistence context is fragile.
301301
If you receive an exception from Hibernate, you should immediately close and discard the current session. Open a new session if you need to, but throw the bad one away first.
302302
====
303303

304+
[CAUTION]
305+
====
306+
Some of these operations require slightly more care than others.
307+
When you call `detach()`, `clear()`, `flush()`, or `refresh()`, you've already strayed from the narrow path.
308+
You didn't stray far--and you probably had a good reason for going there--but you're in territory where Hibernate just has to assume you know what you're doing.
309+
If you start to feel that this terrain is bogging you down, consider using a <<stateless-sessions,stateless session>>.
310+
====
311+
304312
Four of these operations accept _options_, allowing influence over their behavior.
305313

306314
[%breakable,cols="50,~"]

0 commit comments

Comments
 (0)