aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes PostConstruct and PreDestroy Callbacks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "PostConstruct and PreDestroy Callbacks" Watch "PostConstruct and PreDestroy Callbacks" New topic
Author

PostConstruct and PreDestroy Callbacks

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

Guys,

I got this from MK's notes,

"PostConstruct and PreDestroy methods are invoked in an unspecified transaction context and security context."

So we don't have to associate these container callbacks with any transaction context? Any reasons please!


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Originally posted by Jothi Shankar Kumar Sankararaj:
Guys,

I got this from MK's notes,

"PostConstruct and PreDestroy methods are invoked in an unspecified transaction context and security context."

So we don't have to associate these container callbacks with any transaction context? Any reasons please!


PostConstruct and PreDestroy methods are invoked by container for initialization and destruction purpose. These methods are not anyway related to your business methods. I think for this reason, this transaction are not running in the active transaction in which the business logic is handled.
I EJB specification enforce the above conditions.

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PostConstruct and PreDestroy Callbacks