Professional Web Applications Themes

Connection timeouts - MySQL

Hi all. I have a couple of serverprograms running on my Linuxbox that has a connection open to a MySQL (5.0.18) database. These serverprograms doesnt work much :-), they get called by clients once in a while, sometimes it can be days between they have to do any work. When they are started they connect to the MySQL database and then they wait for a client to connect to them and command the server to work vs the database. So, I want the connection to stay alive all the time, but this seems a bit hard...I have tried to set ...

  1. #1

    Default Connection timeouts

    Hi all. I have a couple of serverprograms running on my Linuxbox that
    has a connection open to a MySQL (5.0.18) database. These serverprograms
    doesnt work much :-), they get called by clients once in a while,
    sometimes it can be days between they have to do any work. When they are
    started they connect to the MySQL database and then they wait for a
    client to connect to them and command the server to work vs the
    database. So, I want the connection to stay alive all the time, but this
    seems a bit hard...I have tried to set the MYSQL_OPT_RECONNECT to true
    before issuing the 'mysql_real_connect' call (I'm using the C-api) but
    that doesnt seem to work. The servers gets the
    "--:*MySQL server has gone away"
    back after a while.

    Is there a way to keep a connection alive for a *very* long time if
    desired ?

    Thanx

    /ZW
    ZoombyWoof Guest

  2. #2

    Default Re: Connection timeouts

    You have to set up a timer on your clients app to ping the server
    automatically every time you are close to the timeout setting of the server.


    "ZoombyWoof" <zoombywoofremovethishotmail.com> wrote in message
    news:Gn4Kf.5502$zc1.3520amstwist00...
    > Hi all. I have a couple of serverprograms running on my Linuxbox that has
    > a connection open to a MySQL (5.0.18) database. These serverprograms
    > doesnt work much :-), they get called by clients once in a while,
    > sometimes it can be days between they have to do any work. When they are
    > started they connect to the MySQL database and then they wait for a client
    > to connect to them and command the server to work vs the database. So, I
    > want the connection to stay alive all the time, but this seems a bit
    > hard...I have tried to set the MYSQL_OPT_RECONNECT to true before issuing
    > the 'mysql_real_connect' call (I'm using the C-api) but that doesnt seem
    > to work. The servers gets the
    > "--:*MySQL server has gone away"
    > back after a while.
    >
    > Is there a way to keep a connection alive for a *very* long time if
    > desired ?
    >
    > Thanx
    >
    > /ZW

    Benedictum Guest

  3. #3

    Default Re: Connection timeouts

    SEE -> [url]http://dev.mysql.com/doc/refman/5.0/en/mysql-ping.html[/url]

    --B

    "ZoombyWoof" <zoombywoofremovethishotmail.com> wrote in message
    news:Gn4Kf.5502$zc1.3520amstwist00...
    > Hi all. I have a couple of serverprograms running on my Linuxbox that has
    > a connection open to a MySQL (5.0.18) database. These serverprograms
    > doesnt work much :-), they get called by clients once in a while,
    > sometimes it can be days between they have to do any work. When they are
    > started they connect to the MySQL database and then they wait for a client
    > to connect to them and command the server to work vs the database. So, I
    > want the connection to stay alive all the time, but this seems a bit
    > hard...I have tried to set the MYSQL_OPT_RECONNECT to true before issuing
    > the 'mysql_real_connect' call (I'm using the C-api) but that doesnt seem
    > to work. The servers gets the
    > "--:*MySQL server has gone away"
    > back after a while.
    >
    > Is there a way to keep a connection alive for a *very* long time if
    > desired ?
    >
    > Thanx
    >
    > /ZW

    Benedictum Guest

Similar Threads

  1. session timeouts
    By rgurganus in forum Macromedia ColdFusion
    Replies: 0
    Last Post: June 21st, 04:04 PM
  2. Win 2003 GP Timeouts
    By in forum Windows Server
    Replies: 0
    Last Post: June 17th, 05:42 PM
  3. Timeouts on GetRequestStream()
    By James Delides in forum ASP.NET Web Services
    Replies: 0
    Last Post: June 10th, 01:26 AM
  4. PHP SESSION timeouts
    By Catalin Trifu in forum PHP Development
    Replies: 3
    Last Post: September 3rd, 04:14 PM
  5. Cwd Module - Timeouts
    By George C. Demetros in forum PERL Modules
    Replies: 2
    Last Post: July 23rd, 11:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139