How expensive and costly are savepoints? I wasn't able to find informations about it in the Zope docs. Are they as expensive as sub transactions or are they just using some CPU cycles?

I'm thinking about using savepoints in my migration code. The code is migrating a possible large amount of objects (hundreds up the tenth of thousands). I don't want the code to fail because the last object has an unicode decode issue.


Code example:

for ob in objs:
    savepoint = transaction.savepoint()
    try:
        migrate(ob)
    except ConflictError:
        raise
    except:
        log()
        savepoint.rollback()

If savepoints are costly I would create a new savepoint every 10 or 50 objets.

Christian

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to