Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

connection.commit() SegFault #146

Open
felipeaf opened this Issue · 3 comments

3 participants

felipeaf Victor Volle Michael Olson
felipeaf

Hi!

All my calls for commit() close node with Segmentation Fault. I tested this with setAutoCommit(false).

I tested with Instant Client 12.1

Example:

var oracle = require("oracle")
var INSERT_EXAMPLE= ... //wherever

oracle.connect(connectData, function(err, connection) {
    if (err) { console.log("Error connecting to db:", err); return; }

    connection.setAutoCommit(false)

    connection.execute(INSERT_EXAMPLE, [], function(err, results) {
        if (err) { console.log("Error executing query:", err); return; }

        //WILL SEGFAULT HERE!!!
        connection.commit(function(err) {
            console.log("callback commit")
            console.log(err)
        });
        connection.close(); // call only when query is finished executing
    });
});
Victor Volle

please put the connection.close() inside
the commit callback. You are probably closing the connection before the commit happens.

Shouldnot result in a SegFault, but might be the cause

felipeaf

ok, was wrong here, but i have segfault yet in commit().

My workaround is replace commit and close functions for:

connection.execute("commit", [], function (err, results) {console.log(err); connection.close();} )

Michael Olson

I'm running into this as well, with both commit and rollback on node v0.8.14 and v0.8.21. I've confirmed that doing an execute('commit'...) or execute('rollback', ...) appears to work. I don't close connection at all, since I'm using generic-pool, so it's probably not related to connection.close().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.