[egenix-users] Transactions in Zope DA

Erik Myllymaki erik.myllymaki at aviawest.com
Tue Apr 3 18:35:07 CEST 2007


I am using mxODBC Zope DA 1.0.9 on Windows with Zope Zope 2.9.3, python
2.4.2.

I thought that the following zsql method would update and then insert,
or do neither(in the case of an error in either the update OR the
insert). However, I am seeing data that suggests otherwise.

The connection setting "Use Auto-Commit" is NOT enabled.


update p_status set
to_date = getdate()
where
strata_lot = <dtml-sqlvar strata_lot type=int>
and
usage = <dtml-sqlvar usage type=string>
and
getdate() between from_date and to_date

<dtml-var sql_delimiter>

insert into
p_status(strata_lot,usage,employee,status,notes,client_name,shprice,deposit_date,edited_by,
from_date, to_date)
values(
       <dtml-sqlvar strata_lot type=int>,
       <dtml-sqlvar usage type=string>,
       <dtml-sqlvar employee type=string>,
       <dtml-sqlvar status type=string>,
       <dtml-sqlvar notes type=string>,
       <dtml-sqlvar client_name type=string>,
       <dtml-sqlvar shprice type=float>,
       <dtml-sqlvar deposit_date type=string>,
       <dtml-sqlvar edited_by type=string>, getdate(), '2100-01-01'
       )



More information about the egenix-users mailing list