Open GrassHopper42 opened 1 year ago
EDIT: Issue is resolved by updating to 2.6.12
I have come across this issue as well using the pg node adapter. A single insert works fine, but multiple inserts does not.
try {
await client.query("BEGIN");
for await (const line of lines) {
(() => await client.query("SELECT 1 --etc"))();
}
await client.query("COMMIT");
} catch (err) {
await client.query("ROLLBACK");
throw err;
}
Describe the bug
I think if multiple insert queries is in transaction and transaction fail, all of it should't be in DB, but successful queries committed in DB. It looks like rollback doesn't work.
To Reproduce
pg-mem version
2.6.4