Table of Contents

Class: ConnectionPool Twisted-0.19.0/twisted/enterprise/adbapi.py

I represent a pool of connections to a DB-API 2.0 compliant database.

You can pass keywords args cp_min and cp_max that will specify the size of the thread pool used to serve database requests.

Base Classes   
pb.Referenceable
Methods   
__getstate__
__init__
__setstate__
_runInteraction
_runOperation
_runQuery
close
connect
interaction
operation
query
runInteraction
runOperation
synchronousOperation
  __getstate__ 
__getstate__ ( self )

  __init__ 
__init__ (
        self,
        dbapiName,
        *connargs,
        *connkw,
        )

See ConnectionPool.__doc__

  __setstate__ 
__setstate__ ( self,  state )

  _runInteraction 
_runInteraction (
        self,
        interaction,
        *args,
        *kw,
        )

  _runOperation 
_runOperation (
        self,
        args,
        kw,
        )

This is used for non-query operations that don't want "fetch*" to be called

  _runQuery 
_runQuery (
        self,
        args,
        kw,
        )

  close 
close ( self )

  connect 
connect ( self )

  interaction 
interaction (
        self,
        interaction,
        callback,
        errback,
        *args,
        *kw,
        )

Interact with the database.

Arguments:

  • interaction: a callable object whose first argument is an adbapi.Transaction.

  • args and *kw: additional arguments to be passed to interaction

The callable object presented here will be executed in a pooled thread. callback will be made in the main thread upon success and errback will be called upon failure. If callback is called, that means that the transaction was committed; if errback, it was rolled back. This does not apply in databases which do not support transactions.

  operation 
operation (
        self,
        callback,
        errback,
        *args,
        *kw,
        )

  query 
query (
        self,
        callback,
        errback,
        *args,
        *kw,
        )

  runInteraction 
runInteraction (
        self,
        interaction,
        *args,
        *kw,
        )

  runOperation 
runOperation (
        self,
        *args,
        *kw,
        )

  synchronousOperation 
synchronousOperation (
        self,
        *args,
        *kw,
        )


Table of Contents

This document was automatically generated on Sun Jul 14 19:52:36 2002 by HappyDoc version 2.0