Hello,

I'm trying to implement a stateful session bean that manages its own 
transactions (see the @ejb.bean tag of my sample below).

However, the setSessionContext() method is not called for my sample. If created 
with with a remote interface or with local one, the result is the same, JBoss 
does not go through the setSessionContext() method.

I'm using JBoss 4.0.

Does anybody have an idea what is the problem ? It looks like it is a common 
question raised on the JBoss forums, but there never is any answer or clue 
proposed.

Thanks in advance for any tip.

Fred


Extract of my bean class :
------------------------------

  | import java.rmi.RemoteException;
  | 
  | import javax.ejb.EJBException;
  | import javax.ejb.SessionBean;
  | import javax.ejb.SessionContext;
  | import javax.transaction.NotSupportedException;
  | import javax.transaction.Status;
  | import javax.transaction.SystemException;
  | 
  | import org.apache.log4j.Logger;
  | 
  | import com.rubis.app.basics.loader.interfaces.EquityLoaderException;
  | import com.rubis.util.loader.Record;
  | 
  | /**
  |  * @ejb.bean
  |  *          name="EquityRecordHandler"
  |  *          jndi-name="EquityRecordHandlerBean"
  |  *          type="Stateful"
  |  *          transaction-type="Bean"
  |  */
  | 
  | public abstract class EquityRecordHandlerBean implements SessionBean {
  |     
  |     /** Session context **/
  |     private SessionContext sessionContext;
  |     
  |     /** Logger **/
  |     private static Logger logger = 
Logger.getLogger(EquityRecordHandlerBean.class);
  |             
  |     /**
  |      * Bean creation method
  |      * @ejb.create-method 
  |      */
  |     public void ejbCreate() {
  |     }
  |      
  |     /**
  |      * @see javax.ejb.SessionBean#ejbRemove()
  |      */
  |     public void ejbRemove() throws EJBException, RemoteException {
  |         //sessionContext = null;
  |     }
  |     
  |     /**
  |      * @see 
javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
  |      */
  |     public void setSessionContext(SessionContext context) throws 
EJBException, RemoteException {
  |         this.sessionContext = context; 
  |         logger.info("Session context = " + context);
  |     }
  | 
  |     .../...
  | }
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3854801#3854801

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3854801


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to