[Zodb-checkins] SVN: ZODB/trunk/ Fix small bug that the
Connection.isReadOnly method did not work after a savepoint
Gary Poster
gary at zope.com
Fri Nov 30 12:50:58 EST 2007
Log message for revision 82065:
Fix small bug that the Connection.isReadOnly method did not work after a savepoint
Changed:
U ZODB/trunk/NEWS.txt
U ZODB/trunk/src/ZODB/Connection.py
U ZODB/trunk/src/ZODB/component.xml
U ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py
-=-
Modified: ZODB/trunk/NEWS.txt
===================================================================
--- ZODB/trunk/NEWS.txt 2007-11-30 16:16:05 UTC (rev 82064)
+++ ZODB/trunk/NEWS.txt 2007-11-30 17:50:57 UTC (rev 82065)
@@ -34,6 +34,8 @@
on datetimes or serials (TIDs). See
src/ZODB/historical_connections.txt.
+- (3.9.0a1) Fixed small bug that the Connection.isReadOnly method didn't
+ work after a savepoint.
ZEO
---
Modified: ZODB/trunk/src/ZODB/Connection.py
===================================================================
--- ZODB/trunk/src/ZODB/Connection.py 2007-11-30 16:16:05 UTC (rev 82064)
+++ ZODB/trunk/src/ZODB/Connection.py 2007-11-30 17:50:57 UTC (rev 82065)
@@ -1175,6 +1175,7 @@
self._storage = storage
for method in (
'getName', 'new_oid', 'getSize', 'sortKey', 'loadBefore',
+ 'isReadOnly'
):
setattr(self, method, getattr(storage, method))
Modified: ZODB/trunk/src/ZODB/component.xml
===================================================================
--- ZODB/trunk/src/ZODB/component.xml 2007-11-30 16:16:05 UTC (rev 82064)
+++ ZODB/trunk/src/ZODB/component.xml 2007-11-30 17:50:57 UTC (rev 82065)
@@ -182,8 +182,8 @@
</description>
<key name="historical-pool-size" datatype="integer" default="3"/>
<description>
- The expected maximum number of connections simultaneously open
- per historical revision.
+ The expected maximum total number of historical connections
+ simultaneously open.
</description>
<key name="historical-cache-size" datatype="integer" default="1000"/>
<description>
Modified: ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py 2007-11-30 16:16:05 UTC (rev 82064)
+++ ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py 2007-11-30 17:50:57 UTC (rev 82065)
@@ -138,6 +138,21 @@
>>> db.close()
"""
+def testIsReadonly():
+ """\
+The connection isReadonly method relies on the _storage to have an isReadOnly.
+We simply rely on the underlying storage method.
+
+ >>> import ZODB.tests.util
+ >>> db = ZODB.tests.util.DB()
+ >>> connection = db.open()
+ >>> root = connection.root()
+ >>> root['a'] = 1
+ >>> sp = transaction.savepoint()
+ >>> connection.isReadOnly()
+ False
+"""
+
def test_suite():
return unittest.TestSuite((
doctest.DocFileSuite('testConnectionSavepoint.txt'),
More information about the Zodb-checkins
mailing list