We have the following JPA entities:
@Table(name = "T_PRIZE")
public final class Prize
@Column(updatable = false)
private long id;
private Target target;
public final class Target
@CollectionTable(name = "T_CUTOFF", joinColumns = @JoinColumn(name = "PRIZE_ID"))
private List<CutOff> cutOffs = new LinkedList<CutOff>();
public final class CutOff implements Serializable
@Convert(converter = PenaltiesConverter.class)
private List<IPenalty> penalties;
With above configuration we find so many delete-inserts on table T_CUTOFF even if we don't touch Prize entity. Even simple native 'select SEQ.nextval from DUAL' will trigger delete-insert.
This behavior leads to intermittent bugs in our app where updates to the CutOff entity seems to be not persisted in DB, but it turns out that another thread performs delete-insert on the same table afterwards.
If we remove the @Convert field than the unnecessary delete-inserts no longer happen.
We're aware of JPA auto flush feature, but is this the expected behavior with @Convert in @Embeddable ?
Any help would be greatly appreciated.
Thanks & Regards,