Created
June 4, 2025 01:36
-
-
Save jaimemin/6c2995b2caf5628423afd021ce0903c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Session 전체 Read-Only | |
Session session = entityManager.unwrap(Session.class); | |
session.setDefaultReadOnly(true); | |
// 쿼리별 Read-Only | |
List<Post> posts = entityManager.createQuery("select p from Post p", Post.class) | |
.setHint("org.hibernate.readOnly", true) | |
.getResultList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment