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

Comments

Projects
None yet
2 participants
@codeconsole
Contributor

codeconsole commented Feb 14, 2012

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

This comment has been minimized.

Show comment
Hide comment
@glaforge

glaforge Feb 14, 2012

Contributor

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

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

It feels a bit more natural to me.

Contributor

glaforge commented Feb 14, 2012

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