In my case I was manually setting the ID of an entity that had @GeneratedValue(strategy=IDENTITY)
@GeneratedValue(strategy=IDENTITY)