Unlike most Java hosting providers, we load and unload your code on JVMs as your load patterns change. This will result in static variable static being lost, and as a result you should only expect durability of data stored in the datastore. Transient data should generally be stored in memcache, although data may be evicted from memcache as well.
For more information, see: http://code.google.com/appengine/kb/java.html#What_Causes_Loading_Requests On Thu, Mar 18, 2010 at 9:34 AM, Ali Ok <[email protected]> wrote: > Hi, > I am trying to implement Google App Engine support for Myfaces 2. You > can see the work [1] [2]. > At the moment, I am making some trials to identify the problem at [2]. > > I am experiencing an interesting problem. My filter's static variable > is lost after some time(ie. 3 minutes) > I have a filter like this: > public class TestFilter implements Filter > { > ... > private static String myStaticVariable; > > public void doFilter(ServletRequest arg0, ServletResponse arg1, > FilterChain arg2) throws IOException, ServletException > { > log.warning("myStaticVariable" + myStaticVariable); > if(myStaticVariable==null) > myStaticVariable = "someValue"; > arg2.doFilter(arg0, arg1); > } > ... > } > > When I make the first request, "myStaticVariable" is set to > "someValue". If I make a request in a short period (ie. 20 seconds), I > see that value of "myStaticVariable" is still "someValue". > However, after 3 minutes, when I make another request, I see that > "myStaticVariable" is set to its default value (null). > > Why are my static variables are gone? Am I doing something wrong? > > I can understand that the reconstruction of the filter and loss of > instance variables; we are trying to run our application on cloud. > But loss of static variables are completely weird. > > I couldn't find an issue on Google Code project, thus wanted to ask > you before opening an issue. > > Thanks, > Ali > > > [1] https://issues.apache.org/jira/browse/MYFACES-2559 > [2] https://issues.apache.org/jira/browse/MYFACES-2606 > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" 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-appengine-java?hl=en.
