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

Fix falsly setting autoTransaction #2113

Merged
merged 1 commit into from
Jun 9, 2017
Merged

Fix falsly setting autoTransaction #2113

merged 1 commit into from
Jun 9, 2017

Conversation

dertieran
Copy link
Contributor

@dertieran dertieran commented Jun 8, 2017

When passing a falsy value to transacting a new transaction is created but autoTransaction is set to false so the transaction is never committed or rolled back.

This is a problem because this means batchInsert works different then insert here.
So passing null into transacting works for insert

knex.insert(rows)
    .into('TableName')
    .transacting(null)

but it doesn't for batchInsert

knex.batchInsert('TableName', rows, chunkSize)
    .transacting(null)

When passing a falsy value to transacting a new transaction is created but autoTransaction is set to false so the created transaction is never committed or rolled back.
@wubzz
Copy link
Member

wubzz commented Jun 9, 2017

Thanks!

@wubzz wubzz merged commit fe17280 into knex:master Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants