Retry for database disconnection