Don’t add try..catch to static methods
Use flag to avoid recursive close() calls (encountered in MariaDB).