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

Expose transactional Cypher feature #111

Open
aseemk opened this issue Feb 9, 2014 · 2 comments · May be fixed by #145
Open

Expose transactional Cypher feature #111

aseemk opened this issue Feb 9, 2014 · 2 comments · May be fixed by #145

Comments

@aseemk
Copy link
Member

aseemk commented Feb 9, 2014

New in Neo4j 2.0.

Usage of this API would probably look just like db.query() does today, so that you could get back results and continue to make queries based on them, except that you'd have to explicitly begin and commit the transaction for the effects to persist. (Or for efficiency, explicitly rollback instead of letting it expire.)

How should that be implemented? E.g. a db.beginTransaction() method that returns a Transaction object that has query(), commit(), and rollback() methods? Or have beginTransaction() return a transaction ID, that you could optionally pass to db.query(), db.commitTransaction(), and db.rollbackTransaction()? Or something different altogether?

The REST API implementation of transactional Cypher queries is different than regular Cypher, so that'll need updating too.

@freeeve
Copy link
Contributor

freeeve commented Feb 10, 2014

I like the "returning a Transaction" idea. You can set batch size and automatically batch requests for the client. That's how I did it in https://github.com/wfreeman/cq (although the underlying API was already built-out for me, so I didn't have much choice if I wanted to use it.) I set the default batch size to 100 statements, and built-in automatic keepalives for transactions if they were still alive in my client, which felt like the right thing to do, although some people might argue against that.

@aseemk
Copy link
Member Author

aseemk commented Nov 7, 2014

Getting tackled in the currently ongoing v2 redesign!

Issue: #143 / PR: #145
WIP docs: https://github.com/thingdom/node-neo4j/blob/v2/API_v2.md

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

Successfully merging a pull request may close this issue.

2 participants