[ZODB-Dev] How to resync with current db
Paolo Losi
paolo at linux.netline.it
Thu Feb 3 02:58:43 EST 2005
Hi all,
In order to avoid ConflictError (when possibile),
I've tried several solution:
- transaction.commit() and begin() on a read only transaction
doesn't seem to work
- _p_jar.sync() does what I expected (begin semantics).
but:
> is it "safe" to use? seems to be a private interface...
> does it resync all objects or only the instance on which
it is invoked?
Could be closing the connection and database (and loosing all
the cache) an alternative viable solution?
Thanks!
Paolo
The use case is the following (two processes: A and B):
B: opening DB... done.
B: got OOBTree object reference in root mapping.
B: bt content:
B: bt[0]='test'
A: opening DB... done.
A: got OOBTree object reference in root mapping.
A: bt content:
A: bt[0]='test'
A: setting bt[1]='test2' and committing transaction... done.
A: bt content:
A: bt[0]='test'
A: bt[1]='test2'
B: new transaction with _p_jar.sync()
B: setting bt[1]='test3'.
B: bt content:
B: bt[0]='test'
B: bt[1]='test3'
B: trying to commit...
If I don't use _p_jar.sync() the B transaction blows....
More information about the ZODB-Dev
mailing list