Thread

  1. Sessions, Connections ...

    Christian Marschalek <cm@chello.at> — 2001-05-06T12:22:48Z

    Hi there!
    
    Hope someone helps me on this one:
    
    I'm building a system where users can login and perform some actions
    over html with PHP.
    Now I guess it's the best way to let every script open a connection with
    the database (when needed) and cuts it at the end, isn't it? Now what if
    the user cancles the script?
    
    Thanks and cya Chris
    
    
    
  2. Re: Sessions, Connections ...

    Mitch Vincent <mitch@venux.net> — 2001-05-06T17:20:45Z

        This is probably better suited for the pgsql-php list but that's OK :-)
    
        There is always ignore_user_abort()
    http://www.php.net/manual/en/function.ignore-user-abort.php -- still, when
    the user cancels, it stops execution of the PHP script and all connections
    will be closed (and transactions rolled back, I hope)
    
        PHP scripts (or programs, whichever you prefer) start up and stop every
    time they're accessed, so you do have to have every script open a connection
    to the database (if you're using the database, of course). You can be brave
    and test persistent connections (this allows connection reuse) as the PHP
    developers supposedly fixed the problems in 4.0.5 but I haven't tried it
    since 4.0.5 so I can't comment.
    
        Good luck!
    
    -Mitch
    
    ----- Original Message -----
    From: "Christian Marschalek" <cm@chello.at>
    To: "[GENERAL] PostgreSQL" <pgsql-general@postgresql.org>
    Sent: Sunday, May 06, 2001 8:22 AM
    Subject: Sessions, Connections ...
    
    
    > Hi there!
    >
    > Hope someone helps me on this one:
    >
    > I'm building a system where users can login and perform some actions
    > over html with PHP.
    > Now I guess it's the best way to let every script open a connection with
    > the database (when needed) and cuts it at the end, isn't it? Now what if
    > the user cancles the script?
    >
    > Thanks and cya Chris
    >
    >
    > ---------------------------(end of broadcast)---------------------------
    > TIP 4: Don't 'kill -9' the postmaster
    >