On Jul 9, 2008, at 9:46 PM, fmchale wrote:


Hello,

After much research I have become completely stumped and confused on this
issue (pardon me as well if its something simple, I am learning JEE
development). I currently have a Stateful Session bean that is accessed by web clients. After approximately 20 minutes I get a NoSuchObjectException - Stateful Session Bean has timed out. Is there anyway I can set the timeout to be longer then 20 minutes. Im assuming that after 20 minutes the timeout occurs and instead of passivating the bean is completely destroyed. Here is
a snippet of important bean parts.

public @Stateful class InternTempBean implements InternTemp{

        @PersistenceContext(unitName="MatchMakerModel",
type=PersistenceContextType.EXTENDED)
        EntityManager emMatchMaker;
        
        public InternTempBean(){
        }

       .. some more bean methods

        @Remove
        public void mergeIntern(Intern_Temp intern){
                emMatchMaker.merge(intern);
        }

I was thinking maybe there was some setting I could tell openejb to not
timeout after 20 minutes.
Can anyone guide me in the right direction here.

As you've figured out, the default timeout is 20 minutes.

To alter this default:

1. stop your server
2. edit var/config/config.xml
3. locate the openejb module element and make it looks something like:

<module name="org.apache.geronimo.configs/openejb/2.1.2-SNAPSHOT/ car">
        <gbean name="EJBNetworkService">
<attribute name="port">${OpenEJBPort + PortOffset}</ attribute>
            <attribute name="host">${ServerHostname}</attribute>
        </gbean>
        <gbean name="DefaultStatefulContainer">
            <attribute name="properties">PoolSize=1000
              TimeOut=30</attribute>
        </gbean>
    </module>

For an infinite TimeOut, set the value to 0.

--kevan

Reply via email to