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

Conversation

Projects
None yet
2 participants
@dertieran
Contributor

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)
Fix falsly setting autoTransaction
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

This comment has been minimized.

Collaborator

wubzz commented Jun 9, 2017

Thanks!

@wubzz wubzz merged commit fe17280 into tgriesser:master Jun 9, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment