Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now generally available.

google.appengine.api.datastore.RunInReadOnlyTransaction

Stay organized with collections Save and categorize content based on your preferences.

Runs a function inside a read-only datastore transaction.

A read-only transaction cannot perform writes, but may be able to execute more efficiently.

Runs the user-provided function inside a read-only transaction, retries default number of times.

function a function to be run inside the transaction on all remaining arguments
*args positional arguments for function.
**kwargs keyword arguments for function.

the function's return value, if any

TransactionFailedError, if the transaction could not be committed.