Source: factory.core/ObjConnectionPool.py
Thread-safe connection pool for database connections.
Manages a pool of database connections that can be safely shared across
multiple threads. Connections are reused to reduce overhead and prevent
connection exhaustion.
...
| Method | Signature | Description |
|---|---|---|
| acquire | acquire(timeout: Optional[float] = None, max_retries: int = 3) -> object |
Acquire a connection from the pool with validation and retry logic. |
| release | release(conn: object) |
Return a connection to the pool. |
| close_all | close_all() |
Close all connections in the pool. |
| get_stats | get_stats() -> dict |
Get pool statistics. |
Wrapper for pooled database connection.
Automatically returns connection to pool when closed.
| Method | Signature | Description |
|---|---|---|
| close | close() |
Return connection to pool instead of closing. |
Get or create the global connection pool.