Commit 85398aa0 authored by Gary Poster's avatar Gary Poster

Fix small bug that the Connection.isReadOnly method did not work after a savepoint

parent edea5b56
...@@ -34,6 +34,8 @@ General ...@@ -34,6 +34,8 @@ General
on datetimes or serials (TIDs). See on datetimes or serials (TIDs). See
src/ZODB/historical_connections.txt. src/ZODB/historical_connections.txt.
- (3.9.0a1) Fixed small bug that the Connection.isReadOnly method didn't
work after a savepoint.
ZEO ZEO
--- ---
......
...@@ -1175,6 +1175,7 @@ class TmpStore: ...@@ -1175,6 +1175,7 @@ class TmpStore:
self._storage = storage self._storage = storage
for method in ( for method in (
'getName', 'new_oid', 'getSize', 'sortKey', 'loadBefore', 'getName', 'new_oid', 'getSize', 'sortKey', 'loadBefore',
'isReadOnly'
): ):
setattr(self, method, getattr(storage, method)) setattr(self, method, getattr(storage, method))
......
...@@ -182,8 +182,8 @@ ...@@ -182,8 +182,8 @@
</description> </description>
<key name="historical-pool-size" datatype="integer" default="3"/> <key name="historical-pool-size" datatype="integer" default="3"/>
<description> <description>
The expected maximum number of connections simultaneously open The expected maximum total number of historical connections
per historical revision. simultaneously open.
</description> </description>
<key name="historical-cache-size" datatype="integer" default="1000"/> <key name="historical-cache-size" datatype="integer" default="1000"/>
<description> <description>
......
...@@ -138,6 +138,21 @@ Verify all the values are as expected: ...@@ -138,6 +138,21 @@ Verify all the values are as expected:
>>> db.close() >>> 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(): def test_suite():
return unittest.TestSuite(( return unittest.TestSuite((
doctest.DocFileSuite('testConnectionSavepoint.txt'), doctest.DocFileSuite('testConnectionSavepoint.txt'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment