Commit 93329980 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent aa3a9abf
......@@ -113,7 +113,6 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
if zf.wfileh == nil:
zconn = zf.zself._p_jar
assert zconn is not None
# XXX locking? or rely on that ZODB objects for zconn must be used from under 1 thread only?
# join zconn to wconn; link to wconn from _ZBigFile
pywconn = pywconnOf(zconn)
......@@ -127,14 +126,14 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
# pywconnOf establishes and returns (py) wcfs.Conn associated with zconn.
#
# returned wcfs.Conn will be maintained to keep in sync with zconn.
# returned wcfs.Conn will be maintained to keep in sync with zconn, and will be
# closed when zconn is destroyed.
#
# XXX closed on zconn dealloc ?
# XXX simultaneous call?
# XXX move -> .py ?
# It is invalid to make simultaneous calls to pywconnOf with the same zconn.
# (in ZODB/py objects for zconn must be used from under 1 thread only).
cdef wcfs.PyConn pywconnOf(zconn):
assert isinstance(zconn, ZConnection)
assert zconn.opened # XXX needed?
assert zconn.opened
# XXX locking
wconn = getattr(zconn, '_wcfs_wconn', None)
......@@ -164,8 +163,7 @@ class ZSync:
# .wconn (py) wcfs.Connection
def __init__(zsync, zconn, wconn):
#print('ZSync %r %r' % (zconn, wconn))
assert zconn.open
assert zconn.opened
zsync.wconn = wconn
zsync.zconn_ref = weakref.ref(zconn, zsync.on_zconn_dealloc)
......@@ -183,7 +181,5 @@ class ZSync:
# DB resyncs .zconn onto new database view.
# -> resync .wconn to updated database view of ZODB connection.
def on_connection_resync(zsync):
#print('\nZZZSync.resync %r %r' % (zsync.zconn, zsync.wconn))
#import traceback; traceback.print_stack()
zconn = zsync.zconn_ref()
zsync.wconn.resync(zconn_at(zconn))
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