Skip to content

Question about closing connection after transaction commit #1066

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

Closed
sarunl opened this issue Apr 29, 2015 · 2 comments
Closed

Question about closing connection after transaction commit #1066

sarunl opened this issue Apr 29, 2015 · 2 comments
Labels

Comments

@sarunl
Copy link

sarunl commented Apr 29, 2015

From the example in Transaction section, the transaction ends with commit or rollback. I am wondering if i should connection.release() after the transaction is commit or rollback?

if yes, where should it put it? inside function or just after this statement

connection.commit(function(err) {
        if (err) {
          connection.rollback(function() {
            throw err;
          });
        }
e.log('success!');
      });
@sarunl
Copy link
Author

sarunl commented Apr 29, 2015

same question
#934

@dougwilson
Copy link
Member

Let us know if you have any follow-up questions :)!

@dougwilson dougwilson reopened this Apr 29, 2015
@mysqljs mysqljs locked and limited conversation to collaborators Feb 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants