Hello,

Jboss 2.2.2 + Tomcat

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

Reply via email to