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

Add optional retry parameter to transactions if failure #113

Open
codeconsole opened this issue Feb 14, 2012 · 1 comment
Open

Add optional retry parameter to transactions if failure #113

codeconsole opened this issue Feb 14, 2012 · 1 comment

Comments

@codeconsole
Copy link
Contributor

http://code.google.com/appengine/docs/java/datastore/transactions.html#Uses_for_Transactions

In case of certain exceptions (ConcurrentModificationException, APIDeadlineExceeded, etc), should be able to retry.

e.g.

datastore.withTransaction {
    def e = datastore.get('User', 1234)
    e.lastLogin = new Date()
    e.save()
}, 3

would retry the above transaction 3 times.

@glaforge
Copy link
Contributor

In terms of signature, I'd go with something like:

datastore.withTransaction(retry: 3) { ... }

It feels a bit more natural to me.

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