FoundationDB Transaction with NodeJs driver does not work

325 Views Asked by At

got a problem here.... the callback of tr.set is NEVER called, the test prints out '1' and kills itself without a message or error...

Tried on node 0.10.20 with fdb 1.0.1

Without Transaction everything is fine, set works, clear works, everything works

'use strict';
var fdb = require('fdb').apiVersion(100),
    path = require('path'),
    db = fdb.open(path.join(__dirname, '..', 'files', 'fdb.cluster'));

db.doTransaction(function (tr, innerCallback) {
    tr.clearRangeStartsWith('foobar::');
    console.log(1);
    tr.set('foobar::foo', new Buffer('bar'), function () {
        console.log(2);
        innerCallback();
    });
}, function (err) {
    console.log(err);
});
1

There are 1 best solutions below

0
On

Damn, that was stupid! Transactions do not have callbacks, alls actions are just "recorded" and sent on commit....