Sun River
Topics about Java SE, Servlet/JSP, JDBC, MultiThread, UML, Design Pattern, CSS, JavaScript, Maven, JBoss, Tomcat, ...
posts - 78,comments - 0,trackbacks - 0
A session bean can implement the SessionSynchronization interface if it wants to be notified about the state of any transaction in which it is involved. Only stateful session beans using container-managed transactions can implement SessionSynchronization. Its use is optional. The methods of SessionSynchronization are callbacks made by the container into the bean, and they mark points within the transaction. Here is the SessionSynchronization interface:
public interface javax.ejb.SessionSynchronization
{
    public abstract void afterBegin() throws RemoteException;
    public abstract void beforeCompletion() throws RemoteException;
    public abstract void afterCompletion(boolean completionStatus) throws 
      RemoteException;
}
posted on 2006-09-18 11:51 Sun River 阅读(204) 评论(0)  编辑  收藏