Page 1 of 1

autoReconnect=true

Posted: 26 May 2009, 07:43
by dieffe
I got this log:

MESSAGE: The last packet successfully received from the server was269336 seconds ago.The last packet sent successfully to the server was 269336 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

How can i solve it?

Posted: 28 May 2009, 05:53
by Lapo
This error is probably reported by the database driver.
It is likely that a connection to the database was held for too long or something similar.
It's difficult to say without knowing what you are doing, which database you use etc... (MySql?)

Usually this problem is solved by configuring the dabase server to allow longer connection times. Alternatively you can send a small "ping" to the database server every few minutes (maybe 10, 15) executing an empty query

Posted: 29 May 2009, 02:53
by jah2488
hrmm this bring up an interesting design question when it comes to programming persistent worlds.

Does the SQLDB connection stay active as long as the player is logged in and should be just pinged and updated regularly and then the connection closed when the user logs off... or should the DB connection be opened for each new update and then closed again before moving on?

I"m sure this depends on numerous factors that I havn't even thought of.

Posted: 29 May 2009, 05:37
by Lapo
Connections are handled by a connection pool which does the hard work for you behind the scenes :)
Since creating DB connections is an expensive operation, the pool allows to reuse connections on each database operation.
The pool is configurable in many aspects. Check the docs:
http://www.smartfoxserver.com/docs/docP ... ddedDb.htm
(end of the document)