I'm using node-oracle module with the following code (from the node-oracle documentation):
var oracle = require("oracle");
oracle.connect({ "hostname": "192.168.1.120/orcl", "user": "USER", "password": "PASS" }, function(err, connection) {
if(err){ console.log("Connect err:" + err); }
if(connection){ console.log("Connection:" + connection); }
// selecting rows
connection.execute("SELECT nickname FROM users WHERE nickname = :1", ['luc'], function(err, results) {
console.log("execution");
console.log("RESULTS:" + results);
console.log("Err:" + err);
});
connection.setAutoCommit(true);
connection.commit(function(err) {
console.log("commiting");
// transaction committed
});
connection.rollback(function(err) {
console.log("rollback");
// transaction rolledback
});
connection.close(); // call this when you are done with the connection
});
This gives me different error messages :
$ node test_node_oracle.js
Connection:[object Connection]
rollback
commiting
execution
RESULTS:undefined
Err:Error: ORA-24324: service handle not initialized
Sometimes it also gives:
$ node test_node_oracle.js
Connection:[object Connection]
Segmentation fault
or also:
$ node test_node_oracle.js
Connection:[object Connection]
commiting
rollback
execution
RESULTS:undefined
Err:Error: ORA-32102: invalid OCI handle
sqlplus access works fine though:
$ sqlplus USER/[email protected]/orcl
SQL*Plus: Release 11.2.0.3.0 Production on Mon Mar 12 15:18:18 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>