Skip to content

How Should I be using connection.transaction #412

@akc42

Description

@akc42

The documentation for connection.transactions says that I can just use the callback parameter

So I call called back to my function with 'err' and 'done' as twp parameters. What it says is when I have completed by transaction I should then call done with either an error or null as its only parameter.

Looking at the code (I'll refer to line numbers in the repository - not the same on my working system but I assume that is because of transpiling with Babel or something). in connection.js at line 763 there is a function called txDone which I think is what gets passed to me as my 'done' callback. However the first thing it does is const args = new Array(arguments.length - 2); which then fails because I passed it only one argument (a null).

Is this a bug. What should I be calling 'done' with?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions