Hello, friends! I have a quick question about Transactions.
I have a Node.js application hosted on a LightSpeed Web Server (Orange Host). The database is on Supabase.
I have a server API that writes to several tables in sequence, triggered by a "Save" button in a form. To ensure data integrity, I grouped all the operations inside a Transaction, so that if an error occurs, a rollback is performed and I don't have to deal with partial records.
To test the Transaction, I inserted a "Throw Error" in the middle of the steps. The rollback worked.
In a second test, I sent an empty repeater, which triggered an error because it was 'required'. The rollback worked again.
However, when the Web Server times out (500 Internal Server Error: Request Timeout), the write operations are partially executed, as if they were outside a Transaction. The rollback doesn't work!
Why does this happen? Are there some "silent" types of errors that don’t trigger a Transaction rollback? Does anyone know?