[Zope-CMF] validateMetadata

Tres Seaver tseaver@zope.com
Thu, 03 Jan 2002 07:09:32 -0500


Antwan Reijnen wrote:

> your help is very much appreciated, thanks again. 
> 
> I wonder however: suppose the metadata is not valid. I first have
> to store it, and ony AFTER storing takes place, I can test it.
> 
> Is there for that situation a way to rollback the editMetadata
> call? I'm not a undo / rollback-expert :-) so sorry for asking
> the obvious.

Because writes to the ZODB are transactional, it is perfectly
fine to first write the attributes and then test them:  if
'validateMetadata' raises an exception, the writes will be
rolled back.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com