Update of /cvsroot/webware/Webware/MiddleKit/Run
In directory usw-pr-cvs1:/tmp/cvs-serv29895/Run
Modified Files:
SQLObjectStore.py
Log Message:
- support new 'Database' setting to specify the database name
- allow the database name to be passed to the constructor (overrides both
the 'Database' setting and using the name of the model)
- new aggressiveGC module level variable and code. used in rare debugging
instances. not advertised in the docs.
Index: SQLObjectStore.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Run/SQLObjectStore.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** SQLObjectStore.py 12 Jul 2002 22:42:59 -0000 1.47
--- SQLObjectStore.py 26 Oct 2002 07:21:20 -0000 1.48
***************
*** 16,19 ****
--- 16,22 ----
+ aggressiveGC = 0
+
+
class UnknownSerialNumberError(SQLObjectStoreError):
"""
***************
*** 148,152 ****
if poolSize:
args = self._dbArgs.copy()
! args['db'] = self._model.sqlDatabaseName()
self._pool = DBPool(self.dbapiModule(), poolSize, **args)
--- 151,156 ----
if poolSize:
args = self._dbArgs.copy()
! if not args.get('db'):
! args['db'] = self._model.sqlDatabaseName()
self._pool = DBPool(self.dbapiModule(), poolSize, **args)
***************
*** 314,317 ****
--- 318,325 ----
to be used.
"""
+ if aggressiveGC:
+ import gc
+ assert gc.isenabled()
+ gc.collect()
self._sqlCount += 1
if self._sqlEcho:
***************
*** 319,322 ****
--- 327,333 ----
self._sqlEcho.write('SQL %04i. %s %s\n' % (self._sqlCount, timestamp, sql))
self._sqlEcho.flush()
+ if self._sqlCount in (2, 3, 4):
+ import traceback as tb
+ tb.print_stack()
conn, cur = self.connectionAndCursor(connection)
self._executeSQL(cur, sql.strip())
***************
*** 345,348 ****
--- 356,363 ----
newConnection() and connect().
"""
+ if aggressiveGC:
+ import gc
+ assert gc.isenabled()
+ gc.collect()
if connection:
conn = connection
***************
*** 467,473 ****
def sqlDatabaseName(self):
! # @@ 2001-06-15 ce: someday we might allow this to be set
! # or at least read from a config file
! return self.name()
--- 482,489 ----
def sqlDatabaseName(self):
! name = self.setting('Database', None)
! if name is None:
! name = self.name()
! return name
|