Commit 2b9759a9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 27c1870a
......@@ -159,20 +159,10 @@ class ZSync:
# zconn = DB.open(transaction_manager=tm)
# tm.commit() # zconn.at updated (zconn.afterCompletion -> zconn.newTransaction)
# tm.commit() # zconn.at updated again
#
# TODO test for that.
#zconn.onOpenCallback(zsync)
zconn.onResyncCallback(zsync)
"""
# DB.open() pops .zconn from connection pool and "opens" for usage.
# -> resync .wconn to new database view of ZODB connection.
#
def on_connection_open(zsync):
print('ZSync.resync %r %r' % (zsync.zconn, zsync.wconn))
zsync.wconn.resync(zconn_at(zsync.zconn))
"""
# 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()
......
......@@ -341,6 +341,10 @@ def test_zodb_onresync():
assert t.nresync == 2
transaction.commit()
assert t.nresync == 3
transaction.commit()
assert t.nresync == 4
transaction.commit()
assert t.nresync == 5
conn.close()
......
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