Skip to content
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

transactionQueries is not iterable #196

Closed
dmpvost opened this issue Aug 18, 2020 · 2 comments · Fixed by #308
Closed

transactionQueries is not iterable #196

dmpvost opened this issue Aug 18, 2020 · 2 comments · Fixed by #308
Labels

Comments

@dmpvost
Copy link

dmpvost commented Aug 18, 2020

I got this issue often, when my cron run some tasks.
What this error mean? What can I do?

Expected Behavior

No error

Current Behavior

[2020-08-18T09:25:04.046Z] ERROR (50) (@Cron) (#01EG0E5NHKBBWS6GP9TRX4C88Z:GET:/cron/task): InternalQuery / transactionQueries is not iterable
SLONIK:
QUERY:
sql: SELECT * FROM process_matchator( 5::INTEGER , $1::UUID , $2::INTEGER) as query;
type: SLONIK_TOKEN_SQL
values:
- null
- 7

Possible Solution

Steps to Reproduce

I don't know how to reproduce it..

Logs

@dmpvost dmpvost added the bug label Aug 18, 2020
@gajus
Copy link
Owner

gajus commented Aug 18, 2020

This sounds like it could be a transaction failing and Slonik not being able to re-attempt the transaction because (for some reason) transactionQueries is not set.

@gajus gajus closed this as completed Aug 18, 2020
@gajus gajus reopened this Aug 18, 2020
nponiros added a commit to nponiros/slonik that referenced this issue Nov 6, 2021
Move transaction retry handling to the transaction and nestedTransaction
methods and change it so that the handler function is called again
instead of just replaying the queries that are part of the transaction.
Fixes gajus#163.

Add a second parameter to the transaction method to allow users to
define a retry limit per transaction. If a retry limit is given for a
transaction then the global defined retry limit for transactions is
ignored.

Change executeQuery so that it retries individual queries that failed
with a transaction rollback error. Only queries that are not part of a
transaction are retried. The number of times a query is retried is
specified by the global queryRetryLimit configuration. Fixes gajus#176.

The above change also fixes gajus#196 since the transactionQueries array no
longer exists.
@gajus gajus closed this as completed in #308 Nov 7, 2021
gajus pushed a commit that referenced this issue Nov 7, 2021
Move transaction retry handling to the transaction and nestedTransaction
methods and change it so that the handler function is called again
instead of just replaying the queries that are part of the transaction.
Fixes #163.

Add a second parameter to the transaction method to allow users to
define a retry limit per transaction. If a retry limit is given for a
transaction then the global defined retry limit for transactions is
ignored.

Change executeQuery so that it retries individual queries that failed
with a transaction rollback error. Only queries that are not part of a
transaction are retried. The number of times a query is retried is
specified by the global queryRetryLimit configuration. Fixes #176.

The above change also fixes #196 since the transactionQueries array no
longer exists.

BREAKING CHANGE: changes query / transaction retry strategy
@gajus
Copy link
Owner

gajus commented Nov 7, 2021

🎉 This issue has been resolved in version 25.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants