dcsimg

How do I use the @PrePassivate annotation in EJB 3.0?

Byron Tymvios

You will firstly need to import javax.ejb.PrePassivate before you can use the annotation. Then annotate a method with @PrePassivate

@PrePassivate
public void prePassivate(){
    //Place you pre passivate code here
}
A @PrePassivate method will be called by the container directly before the bean is passivated (serialized to temporary storage). This is only required for statefull session beans.