File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes ejb 3.0 - persist(...) description contradiction in API spec Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ejb 3.0 - persist(...) description contradiction in API spec" Watch "ejb 3.0 - persist(...) description contradiction in API spec" New topic
Author

ejb 3.0 - persist(...) description contradiction in API spec

Saeed Amer
Ranch Hand

Joined: Jan 20, 2004
Posts: 135
Hello there,

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.

Many thanks in advance!
Saeed
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
The Javadoc comments in 3.1.1 (and everywhere else in the spec) are situated above the method declaration, not below; which resolves the contradiction
Saeed Amer
Ranch Hand

Joined: Jan 20, 2004
Posts: 135
Thanks Edvins!
I should have paid little more attention
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb 3.0 - persist(...) description contradiction in API spec
 
Similar Threads
Question about entity operations in the JPA Specification
Section 3.2.1 of EJB 3.0 Persistence Specs
detached entity vs. removed entity
How do you update a collection if some exist and some are new?
Persistence