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

Update SQLAlchemy example(s) to use txn retries #4142

Merged
merged 1 commit into from
Jan 8, 2019

Commits on Jan 8, 2019

  1. Update SQLAlchemy example(s) to use txn retries

    Addresses #3315.
    
    Summary of changes:
    
    - Update SQLAlchemy example code to use `run_transaction` function to
      perform txn retries automagically.
    
    - Address the issue that the previous code sample could not be run more
      than once.
    
    - Add note that Python 3 is used for the example code
    
    - Add new 'Best Practices' section that describes what to do (and not
      do) when driving CockroachDB from SQLAlchemy, including:
    
      - Noting that one should not munge txn state inside `run_transaction`.
    
      - Showing some example code to address "transaction too large errors"
        by breaking updates into chunks.
    
      - Recommendation to use IMPORT for bulk work, not ORMs.
    
      - Recommendation to prefer query builder over ORM, if possible.
    
    - Note: All of the changes listed above apply to v2.1 and v2.2
      docs.
    rmloveland committed Jan 8, 2019
    Configuration menu
    Copy the full SHA
    f0decbc View commit details
    Browse the repository at this point in the history