$96 GRAYBYTE WORDPRESS FILE MANAGER $59

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python37/share/doc/alt-python37-psycopg2/doc/src/

HOME
Current File : /opt/alt/python37/share/doc/alt-python37-psycopg2/doc/src//pool.rst
`psycopg2.pool` -- Connections pooling
======================================

.. sectionauthor:: Daniele Varrazzo <daniele.varrazzo@gmail.com>

.. index::
    pair: Connection; Pooling

.. module:: psycopg2.pool

Creating new PostgreSQL connections can be an expensive operation.  This
module offers a few pure Python classes implementing simple connection pooling
directly in the client application.

.. class:: AbstractConnectionPool(minconn, maxconn, \*args, \*\*kwargs)

    Base class implementing generic key-based pooling code.

    New *minconn* connections are created automatically. The pool will support
    a maximum of about *maxconn* connections.  *\*args* and *\*\*kwargs* are
    passed to the `~psycopg2.connect()` function.

    The following methods are expected to be implemented by subclasses:

    .. method:: getconn(key=None)

        Get a free connection from the pool.

        The *key* parameter is optional: if used, the connection will be
        associated to the key and calling `!getconn()` with the same key again
        will return the same connection.

    .. method:: putconn(conn, key=None, close=False)

        Put away a connection.

        If *close* is `!True`, discard the connection from the pool.
        *key* should be used consistently with `getconn()`.

    .. method:: closeall

        Close all the connections handled by the pool.

        Note that all the connections are closed, including ones
        eventually in use by the application.


The following classes are `AbstractConnectionPool` subclasses ready to
be used.

.. autoclass:: SimpleConnectionPool

    .. note:: This pool class is useful only for single-threaded applications.


.. index:: Multithread; Connection pooling

.. autoclass:: ThreadedConnectionPool

    .. note:: This pool class can be safely used in multi-threaded applications.

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 3.40 AM
root / root
0755
_static
--
31 Aug 2024 3.40 AM
root / root
0755
tools
--
31 Aug 2024 3.40 AM
root / root
0755
Makefile
3.309 KB
20 Oct 2019 7.45 AM
root / root
0644
advanced.rst
21.903 KB
20 Oct 2019 7.45 AM
root / root
0644
conf.py
8.267 KB
20 Oct 2019 7.45 AM
root / root
0644
connection.rst
33.257 KB
20 Oct 2019 7.45 AM
root / root
0644
cursor.rst
23.048 KB
20 Oct 2019 7.45 AM
root / root
0644
errorcodes.rst
2.455 KB
20 Oct 2019 7.45 AM
root / root
0644
errors.rst
2.896 KB
20 Oct 2019 7.45 AM
root / root
0644
extensions.rst
32.812 KB
20 Oct 2019 7.45 AM
root / root
0644
extras.rst
35.607 KB
20 Oct 2019 7.45 AM
root / root
0644
faq.rst
14.587 KB
20 Oct 2019 7.45 AM
root / root
0644
index.rst
1.833 KB
20 Oct 2019 7.45 AM
root / root
0644
install.rst
10.31 KB
20 Oct 2019 7.45 AM
root / root
0644
license.rst
0.074 KB
20 Oct 2019 7.45 AM
root / root
0644
module.rst
13.035 KB
20 Oct 2019 7.45 AM
root / root
0644
news.rst
0.105 KB
20 Oct 2019 7.45 AM
root / root
0644
pool.rst
1.822 KB
20 Oct 2019 7.45 AM
root / root
0644
sql.rst
3.021 KB
20 Oct 2019 7.45 AM
root / root
0644
tz.rst
0.529 KB
20 Oct 2019 7.45 AM
root / root
0644
usage.rst
40.679 KB
20 Oct 2019 7.45 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF