xdenser / node-firebird-libfbclient

Firebird SQL binding
MIT License
82 stars 34 forks source link

should we commit? #127

Closed sqllyw closed 1 year ago

sqllyw commented 2 years ago

Hi, sample code below, it's only reading, should we commitSync after the 'select'?

var fb  = require("./firebird");
sys = require("sys"); 
var con = fb.createConnection();
con.connectSync('test.fdb','sysdba','masterkey','');
var res = con.querySync("select * from test");
con.commitSync(); // needed?
var rows = res.fetchSync("all",true);
jackdouglas commented 2 years ago

should we commitSync after the 'select'?

No, con.commitSync() just commits the transaction in Firebird, but you haven't done anything that need committing so it will have no effect.