[Zope-Coders] ZRDB and Transactions

Stephan Richter srichter@cbu.edu
Mon, 15 Oct 2001 12:51:53 -0500


Hello Martijn,

yes, these links you sent were definitely describing the problem, but 
that's not the only one; I have to agree with Dieter.

I digged a little deeper into the rabbit hole and did what Jim suggested 
and I think that solved part of the problem. But now it gets really confusing.

First of all, let me say that if I make _abort() (or tpc_abort() for that 
matter) commit, instead of aborting the PostGreSQL transaction, all 
the  SQL entries (plus the ones that were neglected by Zope because of the 
ConflictError) are in the DB.

But now: I noticed that not the second transaction (the one causing the 
conflict error) causes the irregularities, but the first one does. Even 
though it commits just fine without any conflicts, it causes these 
irregularities described in my first mail. That leads me to think that 
somewhere a conflict error (or something similar) is handled quietly. Is 
that possible?

But then it all does not make sense looking at my first point. Why would 
the abort() of the second transaction be able to commit changes from the 
first one?

This lets me believe that there might be something foul in the PsycoPG 
driver...  Also I think it would be safest to create one internal database 
connection for each transaction. Then these issues could not happen at all! 
(I think...)

If you want to know how it feel to be totally confused and questioning your 
programming skills, have a try at this problem... It is certainly one of 
the more complex ones! :-\ But it has one good thing: You are learning a 
**lot** about the Zope Transaction mechanism. :-)

Regards,
Stephan

--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development & Technical Project Management