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
현재 일정 생성 시 JPA의 saveAll(), deleteAll() 메서드를 호출하고 있습니다. saveAll()과 deleteAll() 메서드는 JPA에서 다수의 엔티티를 일괄적으로 처리할 수 있도록 제공하는 기능인데요.
추가로 hibernate.jdbc.batch_size 옵션을 사용하면 여러 쿼리를 하나의 배치로 묶어 한 번에 처리할 수 있습니다.
하지만 id 생성 전략이 AutoIncrement(Identity) 일 경우
Batch Processing이 Hibernate의 쓰기 지연 철학과 충돌하여 엔티티 수 만큼 개별적인 insert, delete 쿼리가 발생합니다.
Hibernate disables insert batching at the JDBC level transparently if you use an identity identifier generator.
이를 jdbc의 batch update를 직접 구현하여 일괄처리 할 수 있도록 개선합니다.
상세 작업 내용
jdbc batch update를 직접 구현하여 insertAll() 개선
jdbc batch update를 직접 구현하여 deleteAll() 개선
레퍼런스
The text was updated successfully, but these errors were encountered:
이슈 요약
현재 일정 생성 시 JPA의
saveAll()
,deleteAll()
메서드를 호출하고 있습니다.saveAll()
과deleteAll()
메서드는 JPA에서 다수의 엔티티를 일괄적으로 처리할 수 있도록 제공하는 기능인데요.추가로
hibernate.jdbc.batch_size
옵션을 사용하면 여러 쿼리를 하나의 배치로 묶어 한 번에 처리할 수 있습니다.하지만 id 생성 전략이
AutoIncrement(Identity)
일 경우Batch Processing이 Hibernate의 쓰기 지연 철학과 충돌하여 엔티티 수 만큼 개별적인 insert, delete 쿼리가 발생합니다.
이를 jdbc의 batch update를 직접 구현하여 일괄처리 할 수 있도록 개선합니다.
상세 작업 내용
레퍼런스
The text was updated successfully, but these errors were encountered: