Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

PreDestroy and EntityManager operations allowed  RSS feed

 
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!