Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need to know the implementation details of ejbRemove(), ejbActivate for EJB 3.1 exam?

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On p.20 of Frits notes, it says
"The optional SessionBean interface (needed in earlier EJB version) defines 4 methods setSessionContext, ejbRemove..... If the Session bean implements the optional SessionBean
interface and uses the annotations:
@PreDestroy can only be applied on the ejbRemove() method ...."

For EJB 3.1 exam, do we need to know the details of how to implement ejbRemove(), ejbPassivate() , ejbActivate() and setSessionContext() ?

I know in EJB 2.0, we need to provide implementations for these 4 methods when a bean implements SessionBean interface. To my understanding, in EJB 2.0, the developer even needs to set values for transient variables in a Serializable object inside the ejbActivate() method.


 
andrew sydor
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, on the EJB3.1 exam is without EJB2.0 technology.
So you don't need know anything about this methods.

But in EJB3.1 we have interface @PostConstruct, @PreDestroy ... which I can say they are similar.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2535
113
Android Chrome Eclipse IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
andrew sydor wrote:No, on the EJB3.1 exam is without EJB2.0 technology.
So you don't need know anything about this methods.

Correct.

I only added this small part as it can be confusing when you let your "new" EJB implement the "old" SessionBean interface. It is possible but you need to be aware that the "new" annotations (e.g. @PreDestroy) can only be place on specific "old" methods (e.g. ejbRemove)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic