I am completely stumped after working on this issue for 2 days.

I am simply querying a user, updating the name, and sending it back to the 
database.

user = session.query(User).get(1)
user.first_name # John 
user.first_name = 'Sally' 
session.commit()

# > sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'user' 
expected to update 1 row(s); # -1 were matched.

What is causing this error?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/0eed0704-5c66-48f4-a41f-73512b18f858n%40googlegroups.com.

Reply via email to