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

Connection flushing? #38

Open
fabiob opened this issue May 30, 2012 · 0 comments
Open

Connection flushing? #38

fabiob opened this issue May 30, 2012 · 0 comments

Comments

@fabiob
Copy link

fabiob commented May 30, 2012

I'm working on a simple service that receives uploaded files, stores them on the disk and records some metadata on an Oracle table. I'm using the db-oracle package together with connection pooling, following this article: http://nodejsdb.org/2011/05/connection-pooling-node-db-with-generic-pool/

However, I've noticed that the data I insert is only sent to the Oracle database after the connection pool closes the idle connection, by calling its disconnect() method.

I need a way to flush the data before sending the 'OK' signal to my client, otherwise a crash on my webservice or on Oracle itself can cause loss of data. I actually tested this by killing my app process after some uploads, and the data was indeed lost.

As a workaround, I've tried to implement a fake connection pool and release all acquired connections, but now my app is dying with the message: pure virtual method calledAbort trap: 6

Here's the fake connection pooling:

var fakePool = {
  acquire: function(callback) {
    new oracle.Database(config.database).connect(function(err, server) {
      callback(err, this);
    });
  },
  release: function(conn) {
    conn.disconnect();
  }
};

Just to be clear, I don't care about the fake connection pooler, the real problem is the absence of a flush() method or something similar.

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

1 participant