While reading ejb 3.0 persistence spec, I have come across contradicting statements (or at least this is what I believe they are). On page# 43, (3.1.1 EntityManager Interface), it says that (about "persist" operation):
While, on page#49 (Topic: 3.2.1 Persisting An Entity Instance), it says:
I am not sure what should I take from these two contradicting statements.
A 'removed' entity, as per spec, is the one that still has persistence ID, is attached to a persistence Context and is scheduled for removal from DB (so, it hasn't been actually deleted from DB).
Also, page# 49, regarding persist() in section 3.2.1, specs say:
If that is so, then how/when we'll get "Duplicate PK Exception" (whatever is the exact exception name).
I'd highly appreciate if someone can shed some light on these two things.