Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCBCD: Closed entity manager

 
sandeeprajsingh tandon
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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:???

thanks
sandeepraj
 
rajeswari kannan
MyExamCloud Software Support
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please find the following at JPA specification 3.1.1 EntityManager Interface section.



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

 
sandeeprajsingh tandon
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, So what i refered was JPA 1.0, my bad...
Thanks for correcting me

Sandeepraj
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic