|
From: Colin S. <col...@ex...> - 2003-12-08 02:29:54
|
I've modified the EJB support code to allow a user subclass of AbstractStatelessSessionBean to call a new method unloadBeanFactory() from ejbPassivate (which it should implement itself). The subclass should call the existing loadBeanFactory() from ejbCreate() and ejbActivate(). As well, the default implementation of ejbRemove which is in AbstractEnterpriseBean now calls the new unloadBeanFactory() method. There is one change that may affect some existing code, and that is that in the process of adding the above, I modified the existing BeanFactoryLoader interface to handle unloading as well as loading of a beanfactory. These changes should allow you to use a Stateful Session bean properly even wtih passivation and activation happening. Regards, Colin Tim McAuley wrote: > Hi, > > I've just come across this and believe that some alterations may be > needed to the AbstractSessionBean. > > We are using JBoss 3.2.1. > > When a stateful session bean is passivated in our code the following > error appears: > > 12:11:39,611 WARN [AbstractInstanceCache] failed to passivate, > id=dnrbujgy-5 > javax.ejb.EJBException: Could not passivate; failed to save state; > CausedByExcep > tion is: > org.springframework.beans.factory.xml.XmlBeanFactory > at > org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivate > Session(StatefulSessionFilePersistenceManager.java:378) > at > > We make a call to loadBeanFactory() in ejbCreate() but there does not > seem a way to clear the bean factory upon passivation because it is > private. It's easy to called loadBeanFactory() once again at > ejbActivate() but by that time the damage is done and the bean has > probably been removed by the server due to the passivation error. > > Any chance you guys could look at this and maybe add in a fix for M4 > or let me know a suitable work around. > > Many thanks, > > Tim |