• 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, 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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!