Hi !

> Jboss 2.2.2 + Tomcat

Your result are "correct" in the sense that in JBoss 2.2.x the feature of
removing the passivated state of stateful beans was not implemented. So in
your example happened this:
created
passivated (on filesystem)
sleep
activation (from saved state) for getID()
remove (from the cache but not from the filesystem)
...activation again (from saved state).

In JBoss 2.4 is possible to specify a timeout after which passivated beans
are removed from filesystem.
Wait...
Ach, on remove the passivated state is not removed, even in the newest
releases, will fix this asap

So :)
use JBoss 2.4
play with max-bean-age and max-bean-life as workaround.
get the fix when it's available.

Simon

> 
> I have simple stateful session bean. 
> Only:
>   String getID();
>   void setID(String);
> methods
> 
> I've set max-bean-age time to 60, so after 1min my object was 
> passivated.
> I've made following actions at the client side:
> 
>    Hashtable tab = new Hashtable();
> 
>    for(int i = 0; i<110 ; i++) {
>      Synchro obj = home.create();
>      obj.setID(i + System.currentTimeMillis());
>      tab.put(new Integer(i), obj);
>   }
> 
>   Thread.sleep(60000*2);  // wait until passivation occures
> 
>   // this code is executed on passivated object...
>   for(Enumeration e = tab.keys(); e.hasMoreElements();) {
>     Integer key = (Integer)e.nextElement();
>     Synchro val = (Synchro)tab.get(key);
>     System.out.println(key + ": " + val.getID());
>     val.remove();
>   }
> 
> I got proper results, but...
> object is not removed.
> 
> When I repeat (in the same code) 
> 
>   for(Enumeration e = tab.keys(); e.hasMoreElements();) {
>       Integer key = (Integer)e.nextElement();
>       Synchro val = (Synchro)tab.get(key);
>       System.out.println(key + ": " + val.getID());
>       val.remove();
>   }
> 
> Objects are available..., why? I removed this objects by 
> invoking val.remove().
> 
> On the server side:
> 
> [EJBTrans] SynchroEJB (id=null): constructor invoked
> [EJBTrans] SynchroEJB (id=null): setSessionContext invoked
> [EJBTrans] SynchroEJB (id=null): ejbCreate invoked
> [EJBTrans] SynchroEJB (id=null): afterBegin invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): setID invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): beforeCompletion invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): afterCompletion 
> (true) invoked
> 
> 1 minute later
> 
> [Container factory] SynchroEJB (id=6_994852040662): 
> ejbPassivate invoked
> 
> and code (reading Id from bean) twice:
> 
> [EJBTrans] SynchroEJB (id=null): constructor invoked
> [EJBTrans] SynchroEJB (id=null): setSessionContext invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): setSessionContext invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): ejbActivate invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): afterBegin invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): getID invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): beforeCompletion invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): afterCompletion 
> (true) invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): afterBegin invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): ejbRemove invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): beforeCompletion invoked
> [EJBTrans] SynchroEJB (id=6_994852040662): afterCompletion 
> (true) invoked
> 
> and later the same...
> 
> -- 
> Tomasz Sulej
> eo Networks Sp. z o.o.
> tel. +48 22 622 61 85
> kom. +48 606 250 438
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
> 

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to