• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PreDestroy and EntityManager operations allowed

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic