[CalendarServer-changes] [8443] CalendarServer/branches/users/glyph/shared-pool-fixes
source_changes at macosforge.org
source_changes at macosforge.org
Tue Dec 13 13:51:06 PST 2011
Revision: 8443
http://trac.macosforge.org/projects/calendarserver/changeset/8443
Author: glyph at apple.com
Date: 2011-12-13 13:51:05 -0800 (Tue, 13 Dec 2011)
Log Message:
-----------
explicitly account for reporting zero row-count exception separate from zero rows
Modified Paths:
--------------
CalendarServer/branches/users/glyph/shared-pool-fixes/twext/enterprise/adbapi2.py
Property Changed:
----------------
CalendarServer/branches/users/glyph/shared-pool-fixes/
Modified: CalendarServer/branches/users/glyph/shared-pool-fixes/twext/enterprise/adbapi2.py
===================================================================
--- CalendarServer/branches/users/glyph/shared-pool-fixes/twext/enterprise/adbapi2.py 2011-12-13 21:51:00 UTC (rev 8442)
+++ CalendarServer/branches/users/glyph/shared-pool-fixes/twext/enterprise/adbapi2.py 2011-12-13 21:51:05 UTC (rev 8443)
@@ -1108,7 +1108,8 @@
arguments = [('sql', String()),
('queryID', String()),
('args', Pickle()),
- ('blockID', String())] + txnarg()
+ ('blockID', String()),
+ ('reportZeroRowCount', Boolean())] + txnarg()
errors = quashErrors
@@ -1223,7 +1224,8 @@
@failsafeResponder(ExecSQL)
@inlineCallbacks
- def receivedSQL(self, transactionID, queryID, sql, args, blockID):
+ def receivedSQL(self, transactionID, queryID, sql, args, blockID,
+ reportZeroRowCount):
derived = None
noneResult = False
for param in args:
@@ -1235,11 +1237,14 @@
txn = self._blocks[blockID]
else:
txn = self._txns[transactionID]
+ if reportZeroRowCount:
+ rozrc = _NoRows
+ else:
+ rozrc = None
try:
- rows = yield txn.execSQL(sql, args, _NoRows)
+ rows = yield txn.execSQL(sql, args, rozrc)
except _NoRows:
norows = True
- noneResult = True
else:
norows = False
if rows is not None:
@@ -1338,7 +1343,8 @@
class _Query(object):
- def __init__(self, raiseOnZeroRowCount, args):
+ def __init__(self, sql, raiseOnZeroRowCount, args):
+ self.sql = sql
self.args = args
self.results = []
self.deferred = Deferred()
@@ -1444,11 +1450,12 @@
args = []
client = self._client
queryID = str(client._nextID())
- query = client._queries[queryID] = _Query(raiseOnZeroRowCount, args)
+ query = client._queries[queryID] = _Query(sql, raiseOnZeroRowCount, args)
result = (
client.callRemote(
ExecSQL, queryID=queryID, sql=sql, args=args,
- transactionID=self._transactionID, blockID=blockID
+ transactionID=self._transactionID, blockID=blockID,
+ reportZeroRowCount=raiseOnZeroRowCount is not None,
)
.addCallback(lambda nothing: query.deferred)
)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111213/897c347c/attachment.html>
More information about the calendarserver-changes
mailing list