[ZODB-Dev] Webkit Threading and ZODB 3.3a2: problems on Windows
    Dieter Maurer 
    dieter at handshake.de
       
    Sat Feb 21 04:51:52 EST 2004
    
    
  
Matt Feifarek wrote at 2004-2-20 12:06 -0500:
> ...
>BUT, there is still something smelly. It doesn't seem like changing 
>these objects should prevent persistence from happening for the 
>remainder of the application's lifetime. It seems that even if the 
>developer makes a mistake (like we did) it shouldn't leave the entire 
>ZODB behavior unpredictable for other future transactions.
Almost surely, it does not do that.
   But a transaction lives on until it is either committed or aborted.
   This is another reason why you should ensure that each
   "request" ends (reliably) in either a commit or an abort.
   The request should probably be executed in a harness that looks
   like:
	try:
		... process request ...
		get_transaction().commit()
	finally:
		get_transaction().abort()
    This code may abort a transaction without need. But this should
    not be a problem.
    Be aware, too, that a "commit" may result in a "ConflictError".
    In this case, you should abort the transaction and
    (maybe) retry the request.
-- 
Dieter
    
    
More information about the ZODB-Dev
mailing list