For Programmers: Free Programming Magazines  


Home > Archive > PERL POE > June 2005 > Re: LaDBI multiple connections problem Re: SimpleDBI - the same.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: LaDBI multiple connections problem Re: SimpleDBI - the same.
Wiggins d'Anconia

2005-06-09, 4:00 am

Alex wrote:
>
>
>
> Yes, Postgres max_connections=200, I just need to make about 180 DBI
> sessions and use it.
>
> As I said before, I use Randal Schwartz`s script
> (http://www.stonehenge.com/merlyn/Li...l41.listing.txt). I`ve
> added DBI package to save all extracted links to DBI.
>
> Each time when I add a query to DBI I create new session and then there
> are more than 197 sessions there are errors...
>


You start out by creating 298 sessions? j=1 less than 3, is two
iterations, two times i=1 less than or equal to 150 is 298? This happens
before you even start the kernel...

Why the double loop anyways?

for my $i (0..195) {
...
}

>
> Code below:
> ________________________
>
> ...
> use constant LADBI => "ladbi";
> POE::Component::LaDBI->create( Alias => LADBI );
> my $r;
> for(my $j=1;$j<3;$j++)
> {
> for(my $i=1;$i<=150;$i++)
> {
> POE::Component::My::DBI->spawn(SQL => $SQL,EVENT => "insert");
> print "$j : $i\n";
> }
> sleep 1;
> }
> $poe_kernel->run;
> exit 0;
>


[snip]

http://danconia.org
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com