Hi Sumer,

You're storing an entity in the session, and unless the gaeutilities session
object handles this specially, this results in it pickling the 'user' entity
and storing it in the session. Calling .put() on the user object will update
the datastore with the new value, but won't change the pickled value the
session object is storing. Next request, it will deserialize the same data
it did previously, with no update.

-Nick Johnson

On Sat, Mar 6, 2010 at 2:22 PM, Sumer Cip <[email protected]> wrote:

> Hi all,
>
> Below is the code code I am using in my tests to update a reference
> tied to my session, the session object I use if from gaeutilities
> (wrapped it a little). I put a reference object in the session and all
> working fine.
>
>        if not self.Session.user:
>            user = scMember.all().filter("name = ",
> "testmember").get()
>            self.Session.user = user
>        else:
>            self.Session.user.playcount += 1
>            self.Session.user.put()
>
> The problem with this code is the put() is not working, if I do not
> restart app engine SDK. In the error scenario, user is set into the
> session object, and in the second request I can update the playcount
> only once. BUt the subsequent operations fail without any notice of
> error and playcount stays "1" everytime even I have incremented it.
> This is the testhandler and there is no other code running paralelly.
> When I restart the SDK, the problem goes away, it works fine.
> So, I am not sure if I am doing something wrong, it took me 6 hours to
> identify this thing.
>
> Any help will be appericiated.
>
> Thanks,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>


-- 
Nick Johnson, Developer Programs Engineer, App Engine
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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?hl=en.

Reply via email to