thingdom/node-neo4j

Simple Transaction fail - The Transaction has expired - Neo4j 2.3.1 Ent

gpierrick opened this issue · 3 comments

The following code fail and return an error from Neo4j

var tx = neo4j.db.beginTransaction();
    var query = [
        'MATCH (session:Session{id:{id}})',
        'SET session = {props}',
    ].join('\n');
    var paymentQuery = [
        'MATCH (payment:Payment {id: {id}})',
        'SET payment = {props}',
        'RETURN payment'
    ].join('\n');

    tx.cypher({
        query: query,
        params: {
            id: data.session.id,
            props: data.session
        },
    }, function (err) {
        if (err) {
            logger.error(err);
            return cb(err);
        }
        tx.cypher({
            query: paymentQuery,
            params: {
                id: data.payment.id,
                props: data.payment
            },
            commit: true
        }, function (err) {
            if (err) {
                logger.error(err);
                return cb(err);
            }
            return cb(null, true);
        });
    });

Error: See screenshot
error

Running Neo4j 2.3.1 Enterprise

Hi @aseemk any updates on the issue? Thanks!

Sorry for the delay!

Very strange. The tests here exercise transactions pretty thoroughly, and we also use them a bunch with no issues in production.

I wonder if this is a break with Neo4j 2.3.1 or similar. You mentioned you'll try Neo4j 2.2, thanks!

One thing that'll help debug this: are you getting this error upon making the first query? Or the second?

Presumably it's happening on the second query. If so, just before you make the query, can you console.log(tx._expires, 'vs.', Date.now());?

Thanks!

Yeah issue happen in the second query with commit: true. Sure will print the tx._expires

Will update soon.