如何在使用TSocketConnection的三层结构中应用事务(在服务器端)。
我已经查询了许多帖子,没有令我感到满意的答案,难道在三层中(单单midas没有结合使用MTS,CORBA)中就无法使用C/S结构下的BeginTrans等方法了吗?望指教。谢谢
我已经查询了许多帖子,没有令我感到满意的答案,难道在三层中(单单midas没有结合使用MTS,CORBA)中就无法使用C/S结构下的BeginTrans等方法了吗?望指教。谢谢
procedure Trdsales.updatedatabase(const data:olevariant);
var
i:integer;
begin
aqinfo.BeginTrans;
bpprovider.Dspmain.ApplyUpdates(data,-1,i);
if i>=1 then
begin
aqinfo.rollrans;
end else
begin
aqinfo.commtrans;
end;
end;客户
data:olvariant;
data:=cds.delta;
dm.socket.appserver.updatabase(data);
begin
try
begintrans; //启动Transcation
With ADOStoredProc_BaseInfo_Insert do
begin
ADOStoredProc_BaseInfo_Insert.Connection:=ADOConnection1;
ADOStoredProc_BaseInfo_Insert.ProcedureName:='P_BaseInfo_insert_1;1';
{ Close;
SQL.Clear;
SQL.Add(SQL_BaseInfo_Insert);}
Parameters.ParamValues['@Gtin_2']:=vartostr(Gtin1);
Prepared;
Execproc;
showmessage('事务执行成功!');
end;
committrans;
Except
begin
rollbacktrans;
showmessage('事务执行失败!');
// exit;
end;
end;
你的公共方法是怎么实现的望指教。
如果不传Provider参数我如何将数据更新回特定的数据集呢?你提供的方法让我迷惑的也就是在这里,我试过如果用公共的Provider接受数据更新会导致错误:错误内容大概是数据库引擎不知如果处理要更新的数据。你的公共的方法是如何做到的,万望不吝赐教。