NAME
DBIx::QueryByName::DbhPool - A pool of database handles
DESCRIPTION
An instance of DBIx::QueryByName::DbhPool stores the all opened database handles used by the corresponding instances of DBIx::QueryByName, as well as information on how to open database connections.
DO NOT USE DIRECTLY!
INTERFACE
This API is subject to change!
my $pool = DBIx::QueryByName::DbhPool->new();
-
Instanciate DBIx::QueryByName::DbhPool.
$pool->parent($dbixquerybyname)
-
Called after new() to tell the dbh pool of which instance of DBIx::QueryByName it is related to.
$pool->add_credentials($session, @params);
-
Store credentials for opening the database connection named
$session
.@params
is a standard DBI connection string or list. Return the pool. $pool->knows_session($session);
-
Return true if the pool knows connection credentials for a database connection named
$session
. False otherwise. my $dbh = $pool->connect($session);
-
Tries to open the database connection associated with the session name
$session
. Will retry every second indefinitely until success. Return the database handle for the new connection. my $dbh = $pool->disconnect($session);
-
Disconnects the database connection associated with the session name
$session
. Return the pool. my $dbh = $pool->disconnect_all();
-
Disconnects all the database connections in the pool that belong to the running process. Doesn't affect any parent/child process's connections.