Re: [Zope-DB] roll back

2006-08-29 Thread Charlie Clark
Am 30.08.2006, 00:44 Uhr, schrieb Maslak, Michael  
<[EMAIL PROTECTED]>:



Did what you suggested. That is, removed the BEGIN TRANSACTION & COMMIT
TRANSACTION statements. It has the same behavior: a non-atomic commit.
No roll back. mat1 has a new record mat2 errors.


Please keep your reply on list.



   

I don't use DTML - but if your DTML maps to a
try:
this()
except:
that()

Then you are still acting outside the Zope transactional management! I  
suggest you rewrite your code to use two ZSQL methods and call them from a  
PythonScript

simply
context.mat_1()
content.mat_2()

It's easier than you think.

Charlie
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] roll back

2006-08-29 Thread Charlie Clark
Am 30.08.2006, 00:35 Uhr, schrieb Maslak, Michael  
<[EMAIL PROTECTED]>:



It is allowing a record to be committed in mat1 even as mat2 fails.
There is no roll back happening.


Normally, if you leave the transaction management to Zope and the RDBMS  
can manage it, then all transactions will indeed be rolled back by Zope if  
one fails. So, remove the transactional logic from your ZSQL and your  
problems should be over.


Charlie
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] roll back

2006-08-29 Thread Charlie Clark
Am 29.08.2006, 22:42 Uhr, schrieb Maslak, Michael  
<[EMAIL PROTECTED]>:



Can you please correct my mistake or my
misunderstanding?


Yes, you don't need to explicitly start and commit transactions in ZSQL as  
Zoep does this for you.


Charlie
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db