Auto-reconnect to database if connection lost.