On Nov 4, 2010, at 8:17 PM, Lenza McElrath wrote:

> I am getting a StaleDataError when updating a Float column to the same value 
> twice in a row.  This happens because SQLAlchemy thinks that I am changing 
> the value, but then the DB reports that no value was changed. 
> 
> Test case can be seen here: http://pastebin.com/vxFBAMxm

the test fails to note what "sessionmaker" is, if I run it like this:

    e = create_engine('mysql://scott:ti...@localhost/test')
    test_class = UpdateFunctionTest(sessionmaker(e))

the script runs as expected with no errors.   StaleDataError only occurs if you 
execute() an update() or delete() construct that affects the primary key or 
version number of a row in the same transaction as one that also calls flush() 
and also targets that row.  This test doesn't emit any raw SQL constructs nor 
does it modify any primary key attributes or use version ids so no error 
occurs.   Float columns that aren't primary keys have nothing to do with 
StaleDataError.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to