Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gpierrick opened this issue Jan 20, 2016 · 3 comments
Open

Comments

@gpierrick
Copy link

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

@gpierrick
Copy link
Author

Hi @aseemk any updates on the issue? Thanks!

@aseemk
Copy link
Member

aseemk commented Jan 28, 2016

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!

@gpierrick
Copy link
Author

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

Will update soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants