[CalendarServer-changes] [8168] CalendarServer/branches/users/glyph/shared-pool-take2/twext/ enterprise/adbapi2.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Oct 10 08:04:40 PDT 2011
Revision: 8168
http://trac.macosforge.org/projects/calendarserver/changeset/8168
Author: glyph at apple.com
Date: 2011-10-10 08:04:40 -0700 (Mon, 10 Oct 2011)
Log Message:
-----------
Fix for paramstyle / dialect on _NetCommandBlock.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/shared-pool-take2/twext/enterprise/adbapi2.py
Modified: CalendarServer/branches/users/glyph/shared-pool-take2/twext/enterprise/adbapi2.py
===================================================================
--- CalendarServer/branches/users/glyph/shared-pool-take2/twext/enterprise/adbapi2.py 2011-10-10 15:04:24 UTC (rev 8167)
+++ CalendarServer/branches/users/glyph/shared-pool-take2/twext/enterprise/adbapi2.py 2011-10-10 15:04:40 UTC (rev 8168)
@@ -671,6 +671,7 @@
understanding of the SQL dialect in use by the underlying connection is
required. Instead, it provides 'end'.
"""
+ implements(ICommandBlock)
def __init__(self, singleTxn):
self._singleTxn = singleTxn
@@ -1219,15 +1220,14 @@
A client which can execute SQL.
"""
- # See DEFAULT_PARAM_STYLE FIXME above.
- paramstyle = DEFAULT_PARAM_STYLE
- dialect = POSTGRES_DIALECT
-
- def __init__(self):
+ def __init__(self, dialect=POSTGRES_DIALECT, paramstyle=POSTGRES_DIALECT):
super(ConnectionPoolClient, self).__init__()
self._nextID = count().next
self._txns = {}
self._queries = {}
+ # See DEFAULT_PARAM_STYLE FIXME above.
+ self.dialect = dialect
+ self.paramstyle = paramstyle
def newTransaction(self):
@@ -1415,6 +1415,23 @@
self._ended = False
+ @property
+ def paramstyle(self):
+ """
+ Forward 'paramstyle' attribute to the transaction.
+ """
+ return self._transaction.paramstyle
+
+
+ @property
+ def dialect(self):
+ """
+ Forward 'dialect' attribute to the transaction.
+ """
+ return self._transaction.dialect
+
+
+
def execSQL(self, sql, args=None, raiseOnZeroRowCount=None):
"""
Execute some SQL on this command block.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111010/51509bfe/attachment-0001.html>
More information about the calendarserver-changes
mailing list