Commit d0ff628e authored by Jeremy Hylton's avatar Jeremy Hylton

Reformat sync() and exchange(). Change exchange() comment.

parent 50c51b55
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
############################################################################## ##############################################################################
"""Database connection support """Database connection support
$Id: Connection.py,v 1.107 2003/12/31 16:27:29 jeremy Exp $""" $Id: Connection.py,v 1.108 2004/01/02 19:57:12 jeremy Exp $"""
import logging import logging
import sys import sys
...@@ -672,8 +672,9 @@ class Connection(ExportImport, object): ...@@ -672,8 +672,9 @@ class Connection(ExportImport, object):
def sync(self): def sync(self):
self.getTransaction().abort() self.getTransaction().abort()
sync=getattr(self._storage, 'sync', 0) sync = getattr(self._storage, 'sync', 0)
if sync != 0: sync() if sync:
sync()
self._flush_invalidations() self._flush_invalidations()
def getDebugInfo(self): def getDebugInfo(self):
...@@ -693,13 +694,11 @@ class Connection(ExportImport, object): ...@@ -693,13 +694,11 @@ class Connection(ExportImport, object):
self._store_count = 0 self._store_count = 0
return res return res
######################################################################
# Just plain weird. Don't try this at home kids.
def exchange(self, old, new): def exchange(self, old, new):
oid=old._p_oid # called by a ZClasses method that isn't executed by the test suite
new._p_oid=oid oid = old._p_oid
new._p_jar=self new._p_oid = oid
new._p_changed=1 new._p_jar = self
new._p_changed = 1
self.getTransaction().register(new) self.getTransaction().register(new)
self._cache[oid]=new self._cache[oid] = new
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