Tuesday, March 01, 2022

failed to insert 1-to-many entities using Spring Data JPA

may related to this, i have to insert header and 2 lines individually to walk around.

spring-boot-starter-data-jpa:2.6.3

select first 1 header_
select header_
insert into header_
insert into line_
select dbinfo('serial8') from informix.systables where tabid=1
insert into line_
select dbinfo('serial8') from informix.systables where tabid=1
A different object with the same identifier value was already associated with the session :
 nested exception is javax.persistence.EntityExistsException:
A different object with the same identifier value was already associated with the session