diff --git a/sso/services/__init__.py b/sso/services/__init__.py index a540f31..374c99f 100644 --- a/sso/services/__init__.py +++ b/sso/services/__init__.py @@ -80,7 +80,9 @@ class BaseDBService(BaseService): @property def _dbcursor(self): - return self._db.cursor() + if not hasattr(self, '__dbcursor'): + self.__dbcursor = self._db.cursor() + return self.__dbcursor def __del__(self): if hasattr(self, '_db'):