my $dbh = $self->schema->storage->dbh;
-- "Go up to the next female stranger you see and tell her that her "body is a wonderland."
My hypothesis is that she’ll be too busy laughing at you to even bother slapping you." (src)
| [reply] [Watch: Dir/Any] [d/l] [select] |
Great! 10x! It's working!
DBIx creates connection at every query?
Or it uses sheared dbhandle?
May be you read it before me )
| [reply] [Watch: Dir/Any] |
DBIx::Class re-uses existing connections. It checks if connections are still open: if so they are re-used otherwise it reconnects.Please note DBIx::Class is not sharing connections: every my $schema = My::DB->connect('dbi:mysql:DB', 'user', 'secret_password'); will remain separate from every other connection, but every query within an individual $schema will re-use the same connection as long as it is still open. Connections only get closed when the script finishes or when explicitly closed ($schema->disconnect;) or when timed-out server-side.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] [Watch: Dir/Any] [d/l] [select] |