View previous topic :: View next topic |
Author |
Message |
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Jul 15, 2007 22:15 Post subject: |
|
|
Try to set up a script like this and call it on module load:
Code: |
void ping ()
{
SQLExecDirect("SELECT 1");
DelayCommand(600.0, ping);
}
void main()
{
DelayCommand(600.0, ping);
}
|
Pseudocode, but I hope you get the idea. Call the DB every 10 minutes so the connection will not be closed by the server. _________________ Papillon |
|
Back to top |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Mon Jul 16, 2007 9:53 Post subject: |
|
|
From our MySQL log I've noticed there's a conflict, no idea what causes it, I'll post it later when I'll have it handy. |
|
Back to top |
|
|
JohnB
Joined: 11 Jul 2007 Posts: 10
|
Posted: Tue Jul 17, 2007 7:11 Post subject: |
|
|
Thank you. I am going to use a variant of your code that uses the DB every hour. That should be frequently enough to overcome any 'timeout' type problems from the server. I don't have hard data for it - but indications are that (if it is a timing issue) that it is longer than one hour.
For the first few hours that my server is 'up', the persistant clock functions have been using the DB on a regular basis, I will change that to a script that runs once an hour. I will also use the same script to reload the module once a day, just to be on the safe side. |
|
Back to top |
|
|
JohnB
Joined: 11 Jul 2007 Posts: 10
|
Posted: Wed Jul 18, 2007 9:02 Post subject: |
|
|
That seems to be working. 25 hours of continual DB access so far - and counting. Thanks again. |
|
Back to top |
|
|
MetaPhaze
Joined: 03 Jun 2007 Posts: 30 Location: USA
|
Posted: Tue Jul 24, 2007 20:38 Post subject: |
|
|
Sometimes (using nwnx2) the database connection is lost (for some unknown reason) and I run my database on a separate computer system than the one running nwn...
Is there a way to force a re-connect in game?
having to re-start my server with 45 people connected is not always the best way to handle this...
will running SQLInit(); again re-connect me?
is there a way? |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Tue Jul 24, 2007 21:13 Post subject: |
|
|
So far, the problem always was that MySQL closed the connection after a couple of hours with no activity. This has been discussed in this thread.
If you have 45 users on while the MySQL connection goes down, that is probably a different problem. It you are sure the connection has not gone bad during an idle time before that, please post the contents of your nwnx_odbc.txt file in a new thread. _________________ Papillon |
|
Back to top |
|
|
MetaPhaze
Joined: 03 Jun 2007 Posts: 30 Location: USA
|
Posted: Tue Jul 24, 2007 22:09 Post subject: |
|
|
i'm not having issues with it going down...
but if the other system running the db crashes, rather than having to have everyone log off and back on i'd like to know if there is a way to re-connect to the database |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Wed Jul 25, 2007 8:57 Post subject: |
|
|
Ah ok. No, there is no way. You could always modify the sources so it automatically tries to reconnect, of course.
In all honesty, get your DB server stable. Making NWNX reconnect is just an ugly workaround for the real problem. _________________ Papillon |
|
Back to top |
|
|
|