Forums

Problem: Database values reverting after save

Hello,

I'm using a postgresql server and I've been having the most annoying anomaly for a few months now which is driving me crazy

When I update a row's value for some attribute, it seems to be saving correctly and show the updated value. but then, every so often and in inconsistent intervals - I come back to see that the values have reverted to what they were before the changes

Can anyone please provide some insight as to how this can happen?

Thank you very much in advance

Are you committing the changes after making them, either by setting autocommit to true on the connection or by committing them manually?

I am not! Is there a reference I can look at for doing this?

We do not know how your code talks to your Postgres database, but here are the relevant Postgres docs:

PostgreSQL: Documentation: 12: COMMIT

PostgreSQL: Documentation: 12: SET AUTOCOMMIT