On Tue, Apr 2, 2019 at 11:24 AM Christopher Delahunt <christopher.delahunt@xxxxxxxxxx
> You mentions save/merge - which is it?
> You should use em.persist(p); em.flush(); so that the primary key gets set from the IDENTITY in the DB.
> If you are using merge, you must pass back and use the reference returned from the em.merge call or it will be treated as an unmanaged instance, which is why you are getting a separate insert on each call.
I was using the spring data repository save methods. Let me try with the entity manager.