1. Client calls login(), a new row is inserted in the token table.
2. Client calls anotherFunction and the new row is not visible inside
that function
3. If I place a Session.commit() in anotherFunction, then I can see
the row

def login(self, user, pass):
   ' Create new login entry that gives the client an id to pass back
to the server with each request
   newtoken = Token()
   Session.add(newtoken)
   Session.flush()
   Session.commit()
   ' Querying token table at this point shows all the tokens including
the newly added one

def anotherFunction(self, tokenId):
   ' If I list all rows in the token table at this point, the token
created in login() is not visible
   ' If I have a Session.commit() call before I query however, the row
is visible

Other details:
This is in an XMLRPCContoller.
I have a scoped_session setup.

Why is the second function looking at a stale version of the table?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to