MySQL Question

Discussion in 'Plugin Development' started by zachoooo, Oct 16, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    zachoooo

    I am developing a plugin that uses a mysql connection. Only problem is that the connection times out after 8 hours. Which is better, start and stop the connection for every request or just remove the timeout limit for mysql database?
     
  2. Offline

    Deleted user

    Well it's probably a good idea to refresh the connection every so often.. however you don't want to disconnect / reconnect every time you call for the database for stability reasons. I mean there are several ways to go about this its really just what you want to do. Btw my AH sponsors one of my plugins :p
     
  3. Offline

    zachoooo

    So what do you recommend?
     
  4. Offline

    Deleted user

    Well you could have an Integer and every time you call to the DB ++ the int and check it's number and lets say if the int == 50 then refresh the connect and set the int to 0... that way it will refresh every so often.

    Then again 50 is a large number and it just depends on how many times your calling to the DB.
     
  5. Offline

    zachoooo

    I'd say the database is referenced every few seconds, I could have a scheduler add 1 to the database every so often for those few times when the database is rarely referenced.
     
  6. Offline

    Deleted user

    If your going to run a scheduler may as well run a repeating one and evey 30 minutes or so refresh the connection
     
  7. Offline

    zachoooo

    Why didnt you just suggest that in the first place then XD?
     
  8. Offline

    Deleted user

    Because I like to avoid running a constant scheduler at all cost. For resource reasons..
     
Thread Status:
Not open for further replies.

Share This Page