Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB 3 in Action - Question

 
Alankar Agarwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have started to read first edition of EJB 3 in Action. I've few questions as i'm going through the book.

1. For stateful session bean, we use @PrePassivate and @PreDestroy callbacks on same method. Will this cause duplicate (double) invocation in case of Bean destruction?

2. We can have multiple PostConstruct and PreDestroy methods, will they be invoked in a perticular order?

3. In "working with multiple business interfaces", what will access type of parent interface methods (Local) if child has different access type (Remote)
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answers below:
1. Passivation and destruction will never occur together. It's always one or the other.
2. Order is not guaranteed and you should not depend on it.
3. The extending interface settings take precedence, so it will be remote. It's usually a bad idea to use inheritance in this way in the real world.
 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!