Your app becomes shut down if it does not receive any requests for some
time. After that, the next request will initiate a new startup sequence, so
the implementation of the servlet spec is correct.

You should also implement ServletContextListener.contextDestroyed() to
perform cleanup of your data, if needed.

Regards,
Stephan


2010/2/17 AJ Chen <ajc...@web2express.org>

> For standard web app, I use a context listener servlet to do initialization
> at startup. This also works in eclipse with GAE plugin, i.e. the context
> listener is called only once at startup. But, it does not work in production
> because the context listener servlet is called frequently. It seems GAE
> restarts the context or something that triggers the call to the listener
> servlet. SO, the question is:  what's the right way to do one-time
> initialization (e.g. pre-load data) in GAE? Maybe GAE does not have the
> concept of initialization. Any suggestion is appreciated.
> -aj
>
> --
> AJ Chen, PhD
> Chair, Semantic Web SIG, sdforum.org
> http://web2express.org
> @web2express on twitter
> Palo Alto, CA, USA
> 650-283-4091
> *Monitoring social media in real time*
>
> --
> 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
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> 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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to