S
superdba
Unregistered / Unconfirmed
GUEST, unregistred user!
开发环境:delphi7 + windows2000 + oracle9.2数据库
dbexpress事务操作失败,beginTransaction函数返回19,提示multiple transactions not enable
采用SQL维护语句和事务进行操作,当增加和修改记录都成功,但删除就提示:multiple transactions not enable。
不知道如何解决?
部分代码贴下面:
//SQLDataSet: TSQLDataSet
//TD: TTransactionDesc
TD.TransactionID := 1;
TD.IsolationLevel := xilREADCOMMITTED;
if not SQLDataSet.SQLConnection.InTransaction then
begin
strTemp := 'DELETE FROM uverchange WHERE FLOWID = :FLOWID';
SQLDataSet.Close;
SQLDataSet.CommandType := ctQuery;
SQLDataSet.CommandText := strTemp;
SQLDataSet.ParamByName('FLOWID').AsString := CurrentFlowID;
SQLDataSet.SQLConnection.StartTransaction(TD); //出错,
SQLDataSet.ExecSQL;
try
SQLDataSet.SQLConnection.Commit(TD);
MyShowMessage(MSGTITLE, '删除记录成功',MB_OK);
except
SQLDataSet.SQLConnection.Rollback(TD);
MyShowMessage(MSGTITLE, '删除记录失败',MB_OK);
SetControlsEnable(DATA_OPERATION_STATE_BROWSE);
Exit;
end;
dbexpress事务操作失败,beginTransaction函数返回19,提示multiple transactions not enable
采用SQL维护语句和事务进行操作,当增加和修改记录都成功,但删除就提示:multiple transactions not enable。
不知道如何解决?
部分代码贴下面:
//SQLDataSet: TSQLDataSet
//TD: TTransactionDesc
TD.TransactionID := 1;
TD.IsolationLevel := xilREADCOMMITTED;
if not SQLDataSet.SQLConnection.InTransaction then
begin
strTemp := 'DELETE FROM uverchange WHERE FLOWID = :FLOWID';
SQLDataSet.Close;
SQLDataSet.CommandType := ctQuery;
SQLDataSet.CommandText := strTemp;
SQLDataSet.ParamByName('FLOWID').AsString := CurrentFlowID;
SQLDataSet.SQLConnection.StartTransaction(TD); //出错,
SQLDataSet.ExecSQL;
try
SQLDataSet.SQLConnection.Commit(TD);
MyShowMessage(MSGTITLE, '删除记录成功',MB_OK);
except
SQLDataSet.SQLConnection.Rollback(TD);
MyShowMessage(MSGTITLE, '删除记录失败',MB_OK);
SetControlsEnable(DATA_OPERATION_STATE_BROWSE);
Exit;
end;