From ffa20908a6e345bd6093b935f5939ac214133967 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 14 May 2010 14:35:22 +0100 Subject: [PATCH] Use static dbcusor --- sso/services/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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'):