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

Reuse connection? #24

Closed
RobertZito opened this issue Mar 20, 2014 · 1 comment
Closed

Reuse connection? #24

RobertZito opened this issue Mar 20, 2014 · 1 comment

Comments

@RobertZito
Copy link

Is the connection reusable like with the oracle package? Is so would an example be possible?

Oracle.connect = function(callback) {
   oracle_driver.connect(connectData, function(err, connection) {
      if(err) {
         console.log(err);
      } else {
         callback(err, connection);
      }
      connection.close();
   });
}

Oracle.query = function(query, callback) {
   Oracle.connect(function(err, connection) {
      connection.execute(query, [], function(err, results) {
         if (err) {
            console.log(err);
            callback(err, results);
         } else {
            callback(err, results);
         }
      });
   });
}
@patriksimek
Copy link
Collaborator

Yes, connections are reusable.

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

No branches or pull requests

2 participants