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

Support for rolling back transactions. #167

Open
dkushner opened this issue Jun 27, 2015 · 2 comments
Open

Support for rolling back transactions. #167

dkushner opened this issue Jun 27, 2015 · 2 comments

Comments

@dkushner
Copy link

Seraph has excellent support for transactions, something that is sorely missing from most of the other Neo4j clients in the space. However, one of the most powerful applications of these transactions is the ability to manually roll back unwanted change sets from the client. For this reason, the HTTP API provides for a DELETE /db/data/transaction/:txId route. Seraph should likewise support the rolling back of transactions that it has created.

@dkushner
Copy link
Author

My proposal is as follows:

  • Asynchronous API Modifications
var txn = db.batch();

txn.save({ title: 'Kaikki Askeleet' });
txn.save({ title: 'Sinä Nukut Siinä' });
txn.save({ title: 'Pohjanmaa' });

txn.rollback(function(err, results) {
  /* results -> [] */
});
  • Synchronous API Modifications
db.batch(function(txn) {
  txn.save({ title: 'Kaikki Askeleet' });
  txn.save({ title: 'Sinä Nukut Siinä' });
  txn.save({ title: 'Pohjanmaa' });

  txn.rollback();
}, function(err, results) {
  /* results -> [] */
});

@jonpacker, how does this look to you?

@jonpacker
Copy link
Member

I would really love this to be the case, but batch is using the batching API, not the transactional cypher API, which is the API that supports rollbacks. Ultimately I do want to support the transactional cypher API, and rollbacks will of course be a part of that, but I'm having great difficulty finding the time for it. I'll leave this open as a bit of a nag for me to get around to it :)

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

No branches or pull requests

2 participants