-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostgreSQL: transaction() doesn't guarantee use of a database transaction #7068
PostgreSQL: transaction() doesn't guarantee use of a database transaction #7068
Comments
@alxndrsn Thanks for posting! We'll take a look as soon as possible. In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly. For help with questions about Sails, click here. |
Hi @alxndrsn, the code in the files you link is to determine whether or not a function is async. Due to the ad hoc way Sails sniffs async functions and function arguments, it doesn't support certain shorthand for passing in functions. |
@eashaw 👍 that's the cause of the reported bug, which is fixed in my PR |
Hi @eashaw, just revisiting this. Given the expectations around transactional guarantees when working with databases, I think it's dangerously misleading that It would be great if either a fix can be applied, or the documentation can be updated to warn about this possibility. I suspect the |
Related: brianc/node-postgres#2561 |
Node version:
14.15.0
Sails version (sails):
1.4.0
ORM hook version (sails-hook-orm):
2.1.1
DB adapter & version (e.g. [email protected]):
[email protected]
Observed
Calling
datastore.transaction(during)
when using thesails-postgresql
adapter for Waterline doesn't guarantee thatduring
will be run inside a database transaction.If there is no transaction-specific code in the executed SQL, the
during
code will complete without error, so the user may not be aware that their query or queries were not transactional.Steps to recreate
Example project: https://github.com/alxndrsn/sailsjs-postgres-transactions-maybe
Maybe related to #7017.
The text was updated successfully, but these errors were encountered: