You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/src/main/asciidoc/introduction/Interacting.adoc
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1596,7 +1596,7 @@ In this section we'll quickly sketch some general strategies for avoiding "quagm
1596
1596
Even when everything seems to be "working", there might be a lurking <<association-fetching,N+1 selects monster>>.
1597
1597
- Be careful when <<bidirectional-problem,modifying bidirectional associations>>.
1598
1598
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.
1600
1600
Whatever the case, it's up to you to maintain consistency across your model.
1601
1601
- Never <<persistence-contexts,leak a persistence context>> across threads or concurrent transactions.
1602
1602
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
1612
1612
Isolate the problem.
1613
1613
Find the absolute minimum test case which reproduces the behavior, _before_ asking for help online.
1614
1614
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.
1616
1617
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.
1617
1618
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.
1618
1620
- 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.
1620
1622
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.
1621
1623
(Sure, we can be a bit cantankerous at times, but we _do_ always want you to be successful.)
0 commit comments