What exception does com.google.appengine.api.datastore.Transaction.commit() throw when there is a concurrency problem?
I want to retry if there is a concurrency issue, but I don’t know what exception to catch.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As per the docs, it raises a TransactionFailedError. Retrying is a bad idea, though: The error gets thrown when there’s too much contention, and retrying will simply increase the contention. If you want to change the number of retries, use run_in_transaction_custom_retries, documented here.