29#include <sptk5/CaseInsensitiveCompare.h>
30#include <sptk5/db/AutoDatabaseConnection.h>
31#include <sptk5/db/DatabaseConnectionString.h>
32#include <sptk5/db/PoolDatabaseConnection.h>
33#include <sptk5/threads/SynchronizedList.h>
34#include <sptk5/threads/SynchronizedQueue.h>
108 DatabaseConnectionPool(
const String& connectionString,
unsigned maxConnections = 100, std::chrono::seconds connectionTimeout = std::chrono::seconds(60));
110 [[nodiscard]] DatabaseConnection getConnection();
112 std::chrono::seconds connectionTimeout()
const
114 return m_connectionTimeout;
155 size_t m_maxConnections;
156 SynchronizedQueue<SPoolDatabaseConnection> m_pool;
157 SynchronizedList<SPoolDatabaseConnection> m_connections;
158 std::chrono::seconds m_connectionTimeout;
Definition: AutoDatabaseConnection.h:44
Definition: DatabaseConnectionPool.h:96
SPoolDatabaseConnection createConnection()
void releaseConnection(const SPoolDatabaseConnection &connection)
DatabaseConnectionPool(const String &connectionString, unsigned maxConnections=100, std::chrono::seconds connectionTimeout=std::chrono::seconds(60))
Definition: DatabaseConnectionString.h:56
Definition: PoolDatabaseConnection.h:231
void(PoolDatabaseConnection *) DestroyDriverInstance
Definition: DatabaseConnectionPool.h:51
PoolDatabaseConnection *(const char *connectString, size_t connectTimeoutSeconds) CreateDriverInstance
Definition: DatabaseConnectionPool.h:46
uint8_t * DriverHandle
Definition: DatabaseConnectionPool.h:63
Definition: DatabaseConnectionPool.h:70
CreateDriverInstance * m_createConnection
Definition: DatabaseConnectionPool.h:79
DriverHandle m_handle
Definition: DatabaseConnectionPool.h:74
DestroyDriverInstance * m_destroyConnection
Definition: DatabaseConnectionPool.h:84