title: Using JPA, what would cause a new row to be created rather an existing row being updated?
body: <p>When my application comes up, it checks if the entity (of which there should be at most one) exists. If it does not, a new entity is created and persisted. I call <code>EntityManager.persist()</code> (and I have experimentally tried <code>merge()</code> also) the entity, expecting when I stop the application and look at the corresponding table to find a single row but instead I find a row for each persist or merge call. What might I be doing wrong?</p>