O'Reilly logo

Professional Plone Development: Building robust, content-centric web applications with Plone 3, an open source Content Management System by Martin Aspeli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing Database Connections

SQLAlchemy provides a standard interaction pattern for creating engines, metadata, tables, and mappers. However, in the context of a Plone application, we have some particular requirements:

  • Different products may want to manage their own database connections, meaning that we need to be able to manage multiple Engines simultaneously.
  • Zope is a multi-threaded server. We need to ensure that any shared database resources are thread-safe.
  • Database transactions need to be synchronized with Zope transactions. If one fails and rolls back, so should the other.
  • Data source names (DSNs) may not be known until run time, for example if they are stored in the ZODB and exposed as configuration settings to the site administrator.

Luckily, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required