Skip to main content

ZODB context manager

Project description

ZODB context manager

Installation

pip install zodb-cm

ZConnection()

  • Provides a ZODB connection with auto-abort (default).
  • Provides a tuple of connection and root object:
      with ZConnection(db) as cx, root:
          root.one = "ok"
  • ZConnection implements a connection context manager.
  • Transaction context managers in contrast do auto-commit:
    1. with db.transaction() as connection, or
    2. with cx.transaction_manager as transaction, or
    3. with transaction.manager as transaction (for the thread-local transaction manager)
  • See also http://www.zodb.org/en/latest/guide/transactions-and-threading.html

ZDatabase()

  • Provides a ZODB database context manager.

Change History

0.1.0 (2021-02-17)

  • Package creation

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zodb-cm-0.1.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

zodb_cm-0.1-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page