Update of /cvsroot/webware/Webware/MiddleKit/Run
In directory usw-pr-cvs1:/tmp/cvs-serv24643
Modified Files:
MSSQLObjectStore.py
Log Message:
synchronized with latest middlekit conventions
Index: MSSQLObjectStore.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Run/MSSQLObjectStore.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** MSSQLObjectStore.py 20 Jun 2002 17:47:46 -0000 1.5
--- MSSQLObjectStore.py 8 Aug 2002 19:35:52 -0000 1.6
***************
*** 1,8 ****
- #import SQLObjectStore
- #reload (SQLObjectStore)
from SQLObjectStore import SQLObjectStore
! import ODBC.Windows
class MSSQLObjectStore(SQLObjectStore):
"""
MSSQLObjectStore does the obvious: it implements an object store backed by a MSSQL database.
--- 1,8 ----
from SQLObjectStore import SQLObjectStore
! from mx import ODBC # DR: 07-12-02 The ODBC.Windows module is flawed
! ODBC.Windows.threadsafety = ODBC.Windows.threadlevel # mx.ODBC.Windows has a threadlevel, not a threadsafety, even though DBABI2.0 says its threadsafety (http://www.python.org/topics/database/DatabaseAPI-2.0.html)
class MSSQLObjectStore(SQLObjectStore):
+ _threadSafety = ODBC.Windows.threadsafety
"""
MSSQLObjectStore does the obvious: it implements an object store backed by a MSSQL database.
***************
*** 30,36 ****
def retrieveLastInsertId(self, conn, cur):
! result = self.executeSQL('select @@IDENTITY', conn)
! return int(self._cursor.fetchone()[0])
class Klass:
--- 30,43 ----
def retrieveLastInsertId(self, conn, cur):
! conn, cur = self.executeSQL('select @@IDENTITY', conn)
! return int(cur.fetchone()[0])
+ def newConnection(self):
+ args = self._dbArgs.copy()
+ # args['database'] = self._model.sqlDatabaseName()
+ return self.dbapiModule().connect(**args)
+
+ def dbapiModule(self):
+ return ODBC.Windows
class Klass:
***************
*** 41,45 ****
reserved words.
"""
! return '[%s]' % self.sqlTableName()
--- 48,60 ----
reserved words.
"""
! return '[%s]' % self.name()
!
! class Attr:
!
! def sqlColumnName(self):
! """ Returns the SQL column name corresponding to this attribute, consisting of self.name() + self.sqlTypeSuffix(). """
! if not self._sqlColumnName:
! self._sqlColumnName = self.name() + self.sqlTypeSuffix()
! return '[' + self._sqlColumnName + ']'
|