CRDB provides client-side transaction retries, which are available using a special helper-method. This method accepts a callable, which is responsible for executing any transactional statements that may need to be retried.

    1. # Callable that accepts a single argument (the database instance) and
    2. # which is responsible for executing the transactional SQL.
    3. return db.run_transaction(callback, max_attempts=10)

    Note

    For more information, see: