DBIx::Roles::Shared - Share DB connection handles
Caches DB handles for already established connections, and returns these when another connect call is issued. Serves as a replacement to DBI-> connect_cached.
connect
DBI-> connect_cached
The roles allows itself some freedom with calling $self-> dbh at will, in particular, it assumes that result of connect is stored in dbh, and is cleared after dbh. The role probably won't work if these conditions don't hold.
$self-> dbh
dbh
Any change to an intrinsic DBI attribute on a DB handle silently propagates the attribute value to the other DBIx::Roles objects that use the same handle. It is possible to extend the role to virtualize the attributes, but I think that would be an overkill.
DBIx::Roles
Whenever connect is called without previously calling disconnect, the role assumes that the DB handle is being reconnected, and updates all objects that share the handle, with the new connection. This feature allows the role to coexist with DBIx::Roles::AutoReconnect.
disconnect
DBIx::Roles.
Copyright (c) 2005 catpipe Systems ApS. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Dmitry Karasik <dk@catpipe.net>
To install DBIx::Roles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Roles
CPAN shell
perl -MCPAN -e shell install DBIx::Roles
For more information on module installation, please visit the detailed CPAN module installation guide.