logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
MySQL crashes
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Jul 15, 2007 22:15    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Mon Jul 16, 2007 9:53    Post subject: Reply with quote

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
View user's profile Send private message
JohnB



Joined: 11 Jul 2007
Posts: 10

PostPosted: Tue Jul 17, 2007 7:11    Post subject: Reply with quote

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
View user's profile Send private message
JohnB



Joined: 11 Jul 2007
Posts: 10

PostPosted: Wed Jul 18, 2007 9:02    Post subject: Reply with quote

That seems to be working. 25 hours of continual DB access so far - and counting. Thanks again.
Back to top
View user's profile Send private message
MetaPhaze



Joined: 03 Jun 2007
Posts: 30
Location: USA

PostPosted: Tue Jul 24, 2007 20:38    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Jul 24, 2007 21:13    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
MetaPhaze



Joined: 03 Jun 2007
Posts: 30
Location: USA

PostPosted: Tue Jul 24, 2007 22:09    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Jul 25, 2007 8:57    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group