Skip to content

Commit e3ae683

Browse files
committed
clarify a point in the Short Guide
1 parent e9dce35 commit e3ae683

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ In this section we'll quickly sketch some general strategies for avoiding "quagm
15961596
Even when everything seems to be "working", there might be a lurking <<association-fetching,N+1 selects monster>>.
15971597
- Be careful when <<bidirectional-problem,modifying bidirectional associations>>.
15981598
In principle, you should update _both ends_ of the association.
1599-
But Hibernate doesn't strictly enforce that, since there are some situations where such a rule would be too heavy-handed.
1599+
But Hibernate doesn't strictly enforce that, since there are situations where such a rule would be too heavy-handed.
16001600
Whatever the case, it's up to you to maintain consistency across your model.
16011601
- Never <<persistence-contexts,leak a persistence context>> across threads or concurrent transactions.
16021602
Have a strategy or framework to guarantee this never happens.
@@ -1612,11 +1612,13 @@ In this section we'll quickly sketch some general strategies for avoiding "quagm
16121612
Isolate the problem.
16131613
Find the absolute minimum test case which reproduces the behavior, _before_ asking for help online.
16141614
Most of the time, the mere act of isolating the problem will suggest an obvious solution.
1615-
- Avoid frameworks and libraries that "wrap" JPA.
1615+
- If you're new to Hibernate, avoid frameworks and libraries that "wrap" JPA.
1616+
You need an excellent understanding of Hibernate and JPA _first_, before introducing unnecessary additional moving parts.
16161617
If there's any one criticism of Hibernate and ORM that sometimes _does_ ring true, it's that it takes you too far from direct control over JDBC.
16171618
An additional layer just takes you even further.
1619+
If you insist you really do need this extra layer, we beg you to consider https://hibernate.org/repositories/[Hibernate Data Repositories] instead of older third-party solutions.
16181620
- Avoid copy/pasting code from random bloggers or stackoverflow reply guys.
1619-
Many of the suggestions you'll find online just aren't the simplest solution, and many aren't correct for Hibernate 6.
1621+
Many of the suggestions you'll find online just aren't the simplest solution, and many aren't correct for Hibernate 6 and 7.
16201622
Instead, _understand_ what you're doing; study the Javadoc of the APIs you're using; read the JPA specification; follow the advice we give in this document; go direct to the Hibernate team on Zulip.
16211623
(Sure, we can be a bit cantankerous at times, but we _do_ always want you to be successful.)
16221624
- Always consider other options.

0 commit comments

Comments
 (0)