Revert "docs: fix bug in transaction example (#3414)"

This reverts commit dcb4257898d1d8d37110a4364922206dad33f9fe.

The change doesn’t fix the bug it claims to (`finally` always runs) and introduces a resource leak if the `ROLLBACK` query fails. The related bug that a broken client can be returned to the pool remains unaffected either way.
This commit is contained in:
Charmander 2025-04-03 15:10:49 -07:00
parent a5d03a0774
commit a9fd34fb42
No known key found for this signature in database

View File

@ -31,10 +31,10 @@ try {
const insertPhotoValues = [res.rows[0].id, 's3.bucket.foo']
await client.query(insertPhotoText, insertPhotoValues)
await client.query('COMMIT')
client.release()
} catch (e) {
await client.query('ROLLBACK')
client.release()
throw e
} finally {
client.release()
}
```