多层分布式中的事务怎么写啊?
小弟在应用层定义了接口方法,如下,在客户端调用时却不能更新回数据库,
1.请各位帮忙看看是怎么回事?
2.procedure Txsm100.turnmoney(var name1, name2, money: OleVariant);
begin
with ADOConnection2 do
begin
try
begintrans;
with ADOQuery1 do
begin
close;
sql.clear;
sql.add('updata xsm2 set money=money-'+money+' where name like %'+name1+'%');
active:=true;
close;
sql.Clear;
sql.add('updata xsm2 set money=money+'+money+' where name like %'+name2+'%');
active:=true;
end;
showmessage('事务执行成功!');
committrans;
except
rollbacktrans;
showmessage('事务执行失败!');
exit;
end;
end;
end;
其中有表xsm2(name,money);
1.请各位帮忙看看是怎么回事?
2.procedure Txsm100.turnmoney(var name1, name2, money: OleVariant);
begin
with ADOConnection2 do
begin
try
begintrans;
with ADOQuery1 do
begin
close;
sql.clear;
sql.add('updata xsm2 set money=money-'+money+' where name like %'+name1+'%');
active:=true;
close;
sql.Clear;
sql.add('updata xsm2 set money=money+'+money+' where name like %'+name2+'%');
active:=true;
end;
showmessage('事务执行成功!');
committrans;
except
rollbacktrans;
showmessage('事务执行失败!');
exit;
end;
end;
end;
其中有表xsm2(name,money);
...全文
相关推荐
Delphi分布式多层应用开发
delphi分布式多层系统开发,ado,MTS,COM+,MIDAS
分布式多层数据库系统的应用
分布式多层数据库系统的应用分布式多层数据库系统的应用分布式多层数据库系统的应用分布式多层数据库系统的应用分布式多层数据库系统的应用分布式多层数据库系统的应用
J2EE分布式多层体系结构
互联网以及电子商务技术的普及和发展,推动着企业信息系统的构建和更新进程。为了缩短企业信息系统的设计和开发周期、降低构建企业信息系统的成本、在已有系统中对变化的商务规则迅速地做出反映,Sun公司制订了Java2 SDK Enterprise Edition(J2EE)规范,定义基于组件的方式设计、开发、组装和部署企业应用系统的各个组成部分。
delphi分布式多层开发源码
使用MIDAS 、SocketConnection 自己修改一下服务端数据库连接就好了,可以实现互联网连接了,不过服务端如何根据配置文件修改连接的数据库还有待改进。
分布式多层MIS系统在Delphi中的实现.pdf
#资源达人分享计划#


网络通信/分布式开发
