autoReconnect=true

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
dieffe
Posts: 29
Joined: 27 Nov 2008, 09:08

autoReconnect=true

Post 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?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
jah2488
Posts: 19
Joined: 05 May 2009, 04:06

Post 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.
Sic Transit Gloria Mundi
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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)
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply