File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes SCBCD: Closed entity manager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "SCBCD: Closed entity manager" Watch "SCBCD: Closed entity manager" New topic

SCBCD: Closed entity manager

sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 79
I was going through some mock papers and also the EntityManager Api and found this surprising
getTransaction when called on a closed entity manager doesnot throw IllegalStateException, whereas most of the other methods do..even joinTransaction() (when called on a closed em)

Isnt this surprising..want to know people's opinion on why are Specs this way:???

rajeswari kannan
MyExamCloud Software Support
Ranch Hand

Joined: Oct 01, 2006
Posts: 80
Please find the following at JPA specification 3.1.1 EntityManager Interface section.

* @throws IllegalStateException if the entity manager has
* been closed

Rajeswari Kannan
MyExamCloud for Java SE Certifications, Java EE Certifications and Java ME Certification Preparation.
sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 79
Oh, So what i refered was JPA 1.0, my bad...
Thanks for correcting me

I agree. Here's the link:
subject: SCBCD: Closed entity manager
It's not a secret anymore!