Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PreDestroy and EntityManager operations allowed

 
Promod kumar
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the Operations allowed table on page 88, EntityManager Access is not allowed in PreDestroy methods. Section 5.7.1.2, page 126 of the core spec shows an example where PreDestroy method calls em.close(). Is this an error?

I am having a tough time with the operations allowed tables (outside of the obvious cases like container manager bean using getUserTransactions()), any pointers on how to go about it. I did read the reasons why operations are not allowed but they don't cover everything. As an example for stateless session bean why is getBusinessObject of sessionContext not allowed in dependency injection methods but allowed in PostConstruct.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic