Re: Session object instances different. Is this correct?

31 views
Skip to first unread message

jon

unread,
Jan 4, 2013, 6:21:45 AM1/4/13
to google-a...@googlegroups.com


Hi all, I have written a shopping cart application with a shopping cart object being stored in the http session. On each request I'm returned a different object instance. Is this the expected behaviour?

Yes.
 

If I modify my shopping cart object, do I need to store it in the session again every time (at the moment my changes are lost because I'm not doing this)?

Yes, store it again.
 

Works fine in development but not live. Is this to because of the distributed architecture of GAE or am I doing something wrong?

You're correct. App engine spins instances up and down dynamically. Sooner or later the code that reads/writes this data will run on different VMs so obviously you'll get different HttpSession object references.


I really hope you can help or confirm my thoughts on this. Thanks in advance.


Chris

p.s. i'm using struts2, but don't know if that is possibly a problem

Reply all
Reply to author
Forward
0 new messages