티스토리 뷰

;; 상황 

- save 시 duplicate entry 발생

18:29:37,218][JDBCExceptionReporter][logExceptions] SQL Error: 1062, SQLState: 23000

[66.249.79.18][ERROR][2017-12-19 18:29:37,236][JDBCExceptionReporter][logExceptions] Duplicate entry '3205361' for key 'PRIMARY'

[66.249.79.18][ERROR][2017-12-19 18:29:37,236][AbstractFlushingEventListener][performExecutions] Could not synchronize database state with session

org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)

at 


- 두개의 서버가 1개 DB 접근하는 상황

- 해당 개체는 generator class = increment 로 설정된 상태

- db table AUTO INCREMENT 설정 된 상태


;; 해결

generator class = identity 로 변경하여 해결


increment 는 WAS 에서 직접 ID 생성하여 Insert

그러나 MySQL 은 AUTO INCREMENT 적용시 ID 생성하지 않아도 알아서 생성함



https://www.javatpoint.com/generator-classes

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함