Re: [sqlalchemy] sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'PPESSOA' expected to update 1 row(s); 0 were matched.

2023-09-06 Thread Mike Bayer
it can be related to the driver or the "cloud" database you're using, we have lots of reports of SQL Server drivers not reporting on matched rows correctly On Wed, Sep 6, 2023, at 7:40 AM, Leandro Lázaro wrote: > I updated the driver to the latest version and removed the line >

Re: [sqlalchemy] sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'PPESSOA' expected to update 1 row(s); 0 were matched.

2023-09-06 Thread Mike Bayer
changing it to false means if an UPDATE statement that expects to update on primary key in the ORM does not actually match any rows, the program continues and this may be a silent failure, leading to more confusing problems later if the row was in fact deleted or is otherwise non-existent. On

Re: [sqlalchemy] sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'PPESSOA' expected to update 1 row(s); 0 were matched.

2023-09-06 Thread Leandro Lázaro
I updated the driver to the latest version and removed the line 'self.engine.dialect.supports_sane_rowcount = False,' and the same error occurred again. Could this driver also have an unknown bug? TCLOUD_DATABASE_DRIVER_V18 = "/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.3.so.1.1"

Re: [sqlalchemy] sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'PPESSOA' expected to update 1 row(s); 0 were matched.

2023-09-05 Thread Leandro Lázaro
It worked!!! Thank you very much, it solved my problem. I was already going crazy haha. I will try to update the driver to solve the problem right at the root. Just a doubt: Changing to false does not generate any side effects? Em ter., 5 de set. de 2023 às 21:16, Mike Bayer <

Re: [sqlalchemy] sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'PPESSOA' expected to update 1 row(s); 0 were matched.

2023-09-05 Thread Mike Bayer
we will work around what is likely some kind of driver related error: engine = create_engine(" your engine string normally .. ") engine.dialect.supports_sane_rowcount = False then run the program normally. the UPDATE will succeed. however, after the program runs, look in the database

Re: [sqlalchemy] sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'PPESSOA' expected to update 1 row(s); 0 were matched.

2023-09-05 Thread Leandro Lázaro
Hello, apologies for the delay. I'm using SQL Server. Updates using the code below work normally. However, when I try to change the object directly and apply commit, I receive the mentioned error. stmt = update(PPESSOA).where(PPESSOA.CODIGO ==

Re: [sqlalchemy] sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'PPESSOA' expected to update 1 row(s); 0 were matched.

2023-08-22 Thread Mike Bayer
if it's fully reproducible every time with both statements, then this suggests something is happening with the database server itself, such as some kind of issue with triggers getting involved or something. In particular if this is MS SQL Server and there are triggers involved, the updated

[sqlalchemy] sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'PPESSOA' expected to update 1 row(s); 0 were matched.

2023-08-22 Thread Leandro Lázaro
Hello First, thanks for building this library. God bless you I've been trying to understand what's going on for days. This code works fine: https://pastebin.com/fLTnB8jy But if I try to modify any other parameter like PERSONAL EMAIL I get the error: sqlalchemy.orm.exc.StaleDataError: