Hello

Writing a simple program
while (<>) {
   parse($_);
   eval {
      my $tx = $pg->db->begin;
      my $data = $pg->db->select(... { for => \'update skip locked' });
      # Some insert or updates
      $tx->commit;
   };
}


I see on the second transaction a second connect to Pg (while 
max_connections has been explicitly set to 1) and

(before second eval)

postgres 27595  0.0  0.3 289712 15008 ?        Ss   18:38   0:00 postgres: 
11/main: video video 127.0.0.1(36406) idle
postgres 28011  0.0  0.4 289724 16540 ?        Ss   18:41   0:00 postgres: 
11/main: video video 127.0.0.1(36426) idle

(in second eval, before update)
postgres 27595  0.0  0.3 289712 15008 ?        Ss   18:38   0:00 postgres: 
11/main: video video 127.0.0.1(36406) idle
postgres 28011  0.0  0.4 289860 16540 ?        Ss   18:41   0:00 postgres: 
11/main: video video 127.0.0.1(36426) idle in transaction

and finally

(right after $pg->db->update )
postgres 27595  0.0  0.3 289712 15008 ?        Ss   18:38   0:00 postgres: 
11/main: video video 127.0.0.1(36406) idle
postgres 28011  0.0  0.4 289860 16540 ?        Ss   18:41   0:00 postgres: 
11/main: video video 127.0.0.1(36426) idle in transaction
postgres 28025  0.0  0.4 289724 16420 ?        Ss   18:43   0:00 postgres: 
11/main: video video 127.0.0.1(36430) UPDATE waiting

My script suddenly makes two connects and hangs forever, waiting for 
himself to complete something.

What could I do wrong?

--
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to