in reply to Re: Net::Server and DBI
in thread Net::Server and DBI
I guess what I'm not sure about is, if I put the DBI->connect() call before process_request() then will it still be part of the child, or will it belong to the parent?
use base qw(Net::Server::PreFork); MyPackage->new({conf_file => '/home/aaron/serv.conf',})->run; //does $dbh belong to the parent? $dbh = DBI->connect("DBI:mysql:$DSN", $user, $password); sub process_request { //do child stuff here }
As for why I chose to use Net::Server, it seemed easy and reliable. And it is so far. This is my first issue with it directly and I'm nearly done with my app. I'm just trying to make things more efficient, like not having to establish a database connection for each socket connection. I want the sockets to come and go, while I maintain a single DB connection per process.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Net::Server and DBI
by zwon (Abbot) on May 21, 2009 at 18:01 UTC |