[Zope] q: How should I get a guaranteed unique id in Zope?

Richard Jones rjones@ekit-inc.com
Wed, 16 Jan 2002 10:30:13 +1100


On Wed, 16 Jan 2002 10:11, Chris Kratz wrote:
> The only caveat I have found with this behavior was again "by accident". 
> If you are in a python script or dtml and use a try-except clause to catch
> an error within zope, the rollback won't happen.  "Catching" the exception
> keeps zope from triggering the rollback machinery on the database. One
> solution is to rethrow the exception after you have done your own
> processing.

get_transaction().abort() will also roll the transaction back. Similarly, 
get_transaction().commit() will commit.


    Richard