Keep DB Connection Alive

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Angus SC2

    Keep DB Connection Alive

    Hello, I have a connection to a mysql server on my website that I would like
    to keep "alive" from when a user first goes to a page that requires the
    connection until they close the website

    How is it possible to set this up? I do not wish to keep creating the
    connection everytime I wish to execute a query.

    Thank you
    Angus


  • Anthony Papillion II

    #2
    Re: Keep DB Connection Alive


    Angus SC2 <a@b.com> wrote in message news:31kd71F3bi qlbU1@individua l.net...[color=blue]
    > Hello, I have a connection to a mysql server on my website that I would[/color]
    like[color=blue]
    > to keep "alive" from when a user first goes to a page that requires the
    > connection until they close the website
    >
    > How is it possible to set this up? I do not wish to keep creating the
    > connection everytime I wish to execute a query.
    >
    > Thank you
    > Angus[/color]

    Check out mysql_pconnect( )

    Anthony


    Comment

    • Angus SC2

      #3
      Re: Keep DB Connection Alive


      "Anthony Papillion II" <adctech@gmail. com> wrote in message
      news:1102393469 .8b7d360322c5d1 6ff32395c495019 43e@teranews...
      [color=blue]
      >
      > Check out mysql_pconnect( )
      >
      > Anthony
      >
      >[/color]

      Ok, thanks, but I did something pretty stupid in the last post and just said
      it was a mysql connection so that more people could associate with it, in
      fact I am using the Php/java stuff (http://uk.php.net/java) and wish to keep
      the JVM alive throughout the session, any ideas?

      Thanks
      Angus


      Comment

      • Michael Vilain

        #4
        Re: Keep DB Connection Alive

        In article <31ld9uF3btphjU 1@individual.ne t>, "Angus SC2" <a@b.com>
        wrote:
        [color=blue]
        > "Anthony Papillion II" <adctech@gmail. com> wrote in message
        > news:1102393469 .8b7d360322c5d1 6ff32395c495019 43e@teranews...
        >[color=green]
        > >
        > > Check out mysql_pconnect( )
        > >
        > > Anthony
        > >
        > >[/color]
        >
        > Ok, thanks, but I did something pretty stupid in the last post and just said
        > it was a mysql connection so that more people could associate with it, in
        > fact I am using the Php/java stuff (http://uk.php.net/java) and wish to keep
        > the JVM alive throughout the session, any ideas?
        >
        > Thanks
        > Angus[/color]

        I think you're mixing technologies here. Java is meant to connect with
        a running server that stays up and maintains state information. php
        doesn't work that way. Typically, Apache runs a thread that interpets
        the php code, produces the output, then exits. No state information is
        kept from invocation to invocation. They're completely different in how
        they work.

        Reading the page you posted describes several ways of working with Java
        and php. Have you contacted the development teams for them and asked
        your question? What you're trying to do doesn't seem to be on their
        radar.

        --
        DeeDee, don't press that button! DeeDee! NO! Dee...



        Comment

        • CJ Llewellyn

          #5
          Re: Keep DB Connection Alive

          "Angus SC2" <a@b.com> wrote in message
          news:31kd71F3bi qlbU1@individua l.net...[color=blue]
          > Hello, I have a connection to a mysql server on my website that I would[/color]
          like[color=blue]
          > to keep "alive" from when a user first goes to a page that requires the
          > connection until they close the website
          >
          > How is it possible to set this up?[/color]

          It's not possible.[color=blue]
          > I do not wish to keep creating the
          > connection everytime I wish to execute a query.[/color]

          Your problem is not I suspect creating a connection as latency on LAMP
          systems tends to be very low but data persistance.

          Try reading up on sessions.


          Comment

          Working...