Re: [sqlalchemy] Re: MSSQL with PyODBC: StaleDataError on UPDATE statement

2020-06-26 Thread Mike Bayer
yeah that is just disabling the check, the "5000 rows matched" is a critical malfunction referring to non-working primary key. On Fri, Jun 26, 2020, at 10:39 AM, jue...@gmail.com wrote: > Strangely, if I add the following mapper_args, it is working with a warning > (SAWarning: Dialect

[sqlalchemy] Re: MSSQL with PyODBC: StaleDataError on UPDATE statement

2020-06-26 Thread jue...@gmail.com
Strangely, if I add the following mapper_args, it is working with a warning (SAWarning: Dialect mssql+pyodbc does not support updated rowcount - versioning cannot be verified.) but not with an exception. __mapper_args__ = { 'version_id_col': Created, 'version_id_generator':

[sqlalchemy] Re: MSSQL with PyODBC: StaleDataError on UPDATE statement

2020-06-26 Thread jue...@gmail.com
Here is the code I used (simplified): class Measurement(Base): __tablename__ = 'Measurement' __table_args__ = ( {'implicit_returning': False}, # Required because of some triggers on this table ) ID = Column(Integer, primary_key=True) Created = Column(DATETIME2,