To answer your first question: yes, you need to explicitly call setAttribute after modifying an object to replace it in the session.
Regarding the second question, App Engine sessions are implemented using memcache and the datastore, which are distributed across JVMs. If you inspect the data viewer, you should see _ah_SESSION entities, and you can verify whether there is only a single session as you expect or unique sessions per computer. - Jason On Sun, Oct 25, 2009 at 5:32 PM, fvisticot <[email protected]> wrote: > > Step1: > My application is using a session to store a collection of objects. > (session configured in GAE deployment file). > session.setAttribute("mySession", new ArrayList<MyObject>()); > ... > And later: > > List<MyObject> objects = (List<MyObject>)session.getAttribute > ("mySession"); > objects.add(new MyObject()); > > If i only do this code, the new object added in the list is not stored > in the application. > > I need to do a session.setAttribute("mySession", objects); (and with > this setAttribute, the collection is correctly saved). > > Step2: > This session is "shared" with an other session (2 PCs with 2 > differents browsers). > A sessionManager with a map<name, session> is in charge to retrieve a > session from the application. > > From the second brower, the session is retrieved but the collection is > empty... > > What is the pb ? > How to manage the collection of objects in a session with GAE ? do i > need to use memcache instead of session ? > > I assume that the pb is due to multipe JVMs.. but what is the > solution ? > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
