I'm developing an app which uses a MySQL database. The user may leave the app running for days but most of the time the app isn't using the database. Anyway the connection should be kept active. And I'm wondering what's the appropriate approach to verify if the connection actually is still alive?
Should I do a simple query every 5 seconds to verify it?