Thank you, I switched from a member variable to the datastore and it
solved the problem.
There is one thing that is not clear yet:
I've overridden the init() and destroy() methods of the servlet and
added a log printout in each one of them. I can see that the init()
method is called from time to time, but I never get the destroy()
printout.

 @Override
    public void destroy(){
          log("Servlet Destroy after " + counter + " times");
  }

  @Override
  public void init(){
          log("servlet init");
}


On Dec 26, 4:12 am, Bryan Bibat <[email protected]> wrote:
> It's generally a bad idea to store data in member variables because
> containers can create and destroy servlet instances depending on the
> situation (load, idle time, etc).
>
> http://en.wikipedia.org/wiki/Java_Servlet#Lifecycle_of_a_servlet
>
> A better idea would be to persist the data in the datastore.
>
> On Dec 24, 9:37 pm, boaz <[email protected]> wrote:
>
>
>
> > Hello,
>
> > I defined a private member of class HashMap in my RobotServlet class
> > (extending AbstractRobotServlet). I am able to insert values into the
> > map in the ProcessEvents method, and read them later when other events
> > are triggered. However, after some time (can be a few minutes), even
> > if nothing happens on the wave, the map seems to be re-initiated and
> > all the values are gone. What am I missing?
>
> > Thank you,
> > Boaz

--

You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.


Reply via email to