[ZODB-Dev] ReadConflictError while re-indexing big fat index

Christian Robottom Reis kiko at async.com.br
Mon Aug 2 19:20:10 EDT 2004


On Mon, Aug 02, 2004 at 12:34:24PM -0700, sean.upton at uniontrib.com wrote:
> Is there any way to get the new, consistent state for app.foo in the except
> block above, so that I'm not retrying in vain?  Will get_connection().sync()
> do the trick or is there something more?

Well, get_connection().sync() does do something, but whether that is
"the trick" depends on what you want. It will cause the current
transaction to abort, which means reverting the state of all the
persistent objects to what it was before the aborted transaction
started.

If you are happy with abort()ing and retrying the modifications and
commit, it works well. However, it may be the case that you do not have
the modifications handy at this point any longer, which means you will
need to keep the modified state somewhere else (in a non-persistent
object's state, for instance).

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331


More information about the ZODB-Dev mailing list