liuweichuan has asked for the wisdom of the Perl Monks concerning the following question:
for perl, how to manage tht mongodb connection pool? I know it's a connection pool when building an instance, and you can "get" one or more connection. my code is as below,
use MongoDB; our $conn; if(!defined($conn)){ $log->info("Creating new DB connection"); $conn = MongoDB::MongoClient->new; } else{ $log->info("DB connection already exists"); } ...do something...
but, i don't know how to coding the "our $conn" as gloabl arivable. I think the $conn is a long runing connetion, right?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: for perl, how to manage tht mongodb connection pool?
by Corion (Patriarch) on Sep 13, 2016 at 08:05 UTC | |
by liuweichuan (Acolyte) on Sep 13, 2016 at 09:41 UTC | |
by Corion (Patriarch) on Sep 13, 2016 at 09:53 UTC |