On Fri, Dec 27, 2013 at 10:10 AM, Darryl Gouder <dargou...@gmail.com> wrote:
> > As part of an academic assignment I am developing a Java Web Application > that requires the de-serialization of a Dictionary Object File in the > init() method of the start up servlet. For some reason however, when > pressing one of the pages buttons (and hence initiating the doPost() > method) the init is also called and thus the dictionary is de-serialized > *AGAIN.* > The simple solution is to simply keep track of whether you've deserialized the dictionary before; if so, then don't repeat the process. For example: *Hashtable my_table; //global* *//in init* *if (my_table == null) {* *//we haven't deserialized to the internal table. Do the deserialize.* *my_table = doDeserialization();* *}* With that said, init() should not be called twice during the servlet lifecycle. What might be happening is that App Engine is provisioning two different instances, and so init() is being called once per instance, but that seems unlikely unless you have a lot of traffic to your application. On Fri, Dec 27, 2013 at 10:10 AM, Darryl Gouder <dargou...@gmail.com> wrote: > Furthermore the whole process of the de-serialization exceeds 60 seconds > and is thus resulting in a DeadlineExceptionError. > (and also to take as long to process this file). > > There's not much that can be done about this. You're simply putting too much work within the init() function. You need to reduce the run time of your code until it can comfortably execute within the 60 second timer. What you can try is using a higher instance class ( https://developers.google.com/appengine/docs/adminconsole/performancesettings#Setting_the_Frontend_Instance_Class ), more memory and CPU power might help your init function to finish running in less than 60 seconds. ----------------- -Vinny P Technology & Media Advisor Chicago, IL App Engine Code Samples: http://www.learntogoogleit.com -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscr...@googlegroups.com. To post to this group, send email to google-appengine@googlegroups.com. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/groups/opt_out.