사용자 도구

사이트 도구


java:hibernate:batch

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
java:hibernate:batch [2018/12/11 16:26]
kwon37xi
java:hibernate:batch [2020/07/18 19:23]
kwon37xi [기억할 점]
줄 5: 줄 5:
   * [[https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/5/html/Performance_Tuning_Guide/sect-Performance_Tuning_Guide-Entity_Beans-Batching_Database_Operations.html|Performance_Tuning_Guide-Entity_Beans-Batching_Database_Operations]]   * [[https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/5/html/Performance_Tuning_Guide/sect-Performance_Tuning_Guide-Entity_Beans-Batching_Database_Operations.html|Performance_Tuning_Guide-Entity_Beans-Batching_Database_Operations]]
   * [[https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/5/html/Performance_Tuning_Guide/sect-Performance_Tuning_Guide-Entity_Beans-Batch_Inserts.html|4.5.3. Batch Inserts]]   * [[https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/5/html/Performance_Tuning_Guide/sect-Performance_Tuning_Guide-Entity_Beans-Batch_Inserts.html|4.5.3. Batch Inserts]]
 +  * [[https://vladmihalcea.com/how-to-batch-insert-and-update-statements-with-hibernate/|How to batch INSERT and UPDATE statements with Hibernate - Vlad Mihalcea]]
  
 ===== 작동 원리 ===== ===== 작동 원리 =====
줄 14: 줄 15:
   * ''**GenerationType.IDENTITY**'' ID에 대해서는 Batch Insert가 **작동하지 않는다**. ID를 리턴받아 Entity 객체에 채워줘야 하기 때문으로 보인다.   * ''**GenerationType.IDENTITY**'' ID에 대해서는 Batch Insert가 **작동하지 않는다**. ID를 리턴받아 Entity 객체에 채워줘야 하기 때문으로 보인다.
     * [[https://vladmihalcea.com/jpa-persist-and-merge/|How do persist and merge work in JPA]]     * [[https://vladmihalcea.com/jpa-persist-and-merge/|How do persist and merge work in JPA]]
 +    * [[https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#batch-session-batch-insert|Hibernate ORM 5.4.18.Final User Guide]]
 +
  
 > For IDENTITY columns, Hibernate cannot delay the INSERT statement until flush time because the identifier value can only be generated by executing the statement. > For IDENTITY columns, Hibernate cannot delay the INSERT statement until flush time because the identifier value can only be generated by executing the statement.
줄 59: 줄 62:
 <prop key="hibernate.order_updates">true</prop>  <prop key="hibernate.order_updates">true</prop> 
 </code> </code>
 +
 +===== Versioned Data =====
 +  * ''hibernate.jdbc.batch_versioned_data=true'' 로 설정하면 ''@Version'' 컬럼에 대해 대응하여 배치가 실행된다. 자동으로 될 수도 있는데, 일반적으로 ''true''로 하는게 안전할 수 있다.
 +
 +===== 참조 =====
 +  * [[https://www.baeldung.com/jpa-hibernate-batch-insert-update|Batch Insert/Update with Hibernate/JPA | Baeldung]]
  
java/hibernate/batch.txt · 마지막으로 수정됨: 2022/11/13 23:13 저자 kwon37xi