1
votes

My google engine java app looses all user data when user request is redirected to the new instance :

"This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application."

as it is quite inconvenient behaviour i tried to set-up one resident instance so i setted "Idle Instances" to 1-1 but this does not solve my problem i am getting one resident instance and always there`s new (dynamic) instance created which serves some requests... (this guy have the same problem : Why GAE launched a second instance with Max Idle Instances set to 1)

I dont want to use dynamic instances at all (my app have always low load, not many users). I need to serve only one resident instance to the users. Is that possible to set in GAE ? If not , is there any convinient and reliable way how to save data between pages (e.g. store them in datastore ?). I am passing a lot of POST parameters between pages.

1

1 Answers

1
votes

Google App Engine is a cloud platform. Your app design will not be able to get all benefits of cloud platform without dynamic instances.

To solve your data transfer problem you can use one of the following methods:

  1. Use standard Java EE session object. Session is stored in datastore so you will not loose it. But you should not forget that your session object should be SERIALIZABLE and LESS than 1MB because of DataStore entity size limit.

  2. Store data in DataStore manually and transfer Entity ID between pages. Same 1MB Entity size limit applies.

  3. Use BlobStore or Cloud Storage to store your data as files and transfer file idetifier between page. It will help to eliminate 1Mb limit.

Any of this methods allows to persists data between request, but has its own limitations. You need to provide details of your requirements to have a clear answer.