[Zope-Checkins]
SVN: Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py
Putative fix for Collector 1912.
Tim Peters
tim.one at comcast.net
Tue Oct 4 17:13:23 EDT 2005
Log message for revision 38757:
Putative fix for Collector 1912.
File._read_data(): This uses savepoints just to get oids assigned
and to free memory, with no possibility of rollback. Therefore
"optimistic" savepoints should be used: there's no reason here to
insist that any data managers involved support rollback.
Changed:
U Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py
-=-
Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py 2005-10-04 18:28:00 UTC (rev 38756)
+++ Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py 2005-10-04 21:13:22 UTC (rev 38757)
@@ -219,7 +219,7 @@
return True
ranges = HTTPRangeSupport.expandRanges(ranges, self.size)
-
+
if len(ranges) == 1:
# Easy case, set extra header and return partial set.
start, end = ranges[0]
@@ -402,10 +402,10 @@
return result
self.ZCacheable_set(None)
-
+
data=self.data
if type(data) is type(''):
- RESPONSE.setBase(None)
+ RESPONSE.setBase(None)
return data
while data is not None:
@@ -516,7 +516,7 @@
# Make sure we have an _p_jar, even if we are a new object, by
# doing a sub-transaction commit.
- transaction.savepoint()
+ transaction.savepoint(optimistic=True)
if self._p_jar is None:
# Ugh
@@ -533,7 +533,7 @@
if pos < n:
pos = 0 # we always want at least n bytes
seek(pos)
-
+
# Create the object and assign it a next pointer
# in the same transaction, so that there is only
# a single database update for it.
@@ -542,7 +542,7 @@
data.next = next
# Save the object so that we can release its memory.
- transaction.savepoint()
+ transaction.savepoint(optimistic=True)
data._p_deactivate()
# The object should be assigned an oid and be a ghost.
assert data._p_oid is not None
More information about the Zope-Checkins
mailing list