Commit fb47be2f authored by Jim Fulton's avatar Jim Fulton

Make sure the temporary savepoint storage is closed properly.

parent f9e7bc14
...@@ -1099,7 +1099,7 @@ class Connection(ExportImport, object): ...@@ -1099,7 +1099,7 @@ class Connection(ExportImport, object):
src = self._savepoint_storage src = self._savepoint_storage
self._storage = self._normal_storage self._storage = self._normal_storage
self._savepoint_storage = None self._savepoint_storage = None
try:
self._log.debug("Committing savepoints of size %s", src.getSize()) self._log.debug("Committing savepoints of size %s", src.getSize())
oids = src.index.keys() oids = src.index.keys()
...@@ -1111,11 +1111,13 @@ class Connection(ExportImport, object): ...@@ -1111,11 +1111,13 @@ class Connection(ExportImport, object):
data, serial = src.load(oid, src) data, serial = src.load(oid, src)
obj = self._cache.get(oid, None) obj = self._cache.get(oid, None)
if obj is not None: if obj is not None:
self._cache.update_object_size_estimation(obj._p_oid, len(data)) self._cache.update_object_size_estimation(
obj._p_oid, len(data))
obj._p_estimated_size = len(data) obj._p_estimated_size = len(data)
if isinstance(self._reader.getGhost(data), Blob): if isinstance(self._reader.getGhost(data), Blob):
blobfilename = src.loadBlob(oid, serial) blobfilename = src.loadBlob(oid, serial)
s = self._storage.storeBlob(oid, serial, data, blobfilename, s = self._storage.storeBlob(
oid, serial, data, blobfilename,
'', transaction) '', transaction)
# we invalidate the object here in order to ensure # we invalidate the object here in order to ensure
# that that the next attribute access of its name # that that the next attribute access of its name
...@@ -1127,6 +1129,7 @@ class Connection(ExportImport, object): ...@@ -1127,6 +1129,7 @@ class Connection(ExportImport, object):
'', transaction) '', transaction)
self._handle_serial(oid, s, change=False) self._handle_serial(oid, s, change=False)
finally:
src.close() src.close()
def _abort_savepoint(self): def _abort_savepoint(self):
......
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