fcl-db: sqldb: TSQLTransaction.EndTransaction should end transaction (a do not leave it active). So caCommitRetaining and caRollbackRetaining are only aliases of caCommit, caRollback in this case. Bug #26068

git-svn-id: trunk@27738 -
This commit is contained in:
lacak 2014-05-05 10:36:22 +00:00
parent 2d38cf0dbd
commit aa62089fb3

View File

@ -1665,15 +1665,11 @@ procedure TSQLTransaction.EndTransaction;
begin begin
Case Action of Case Action of
caCommit : caCommit, caCommitRetaining :
Commit; Commit;
caCommitRetaining :
CommitRetaining;
caNone, caNone,
caRollback : caRollback, caRollbackRetaining :
RollBack; RollBack;
caRollbackRetaining :
RollbackRetaining;
end; end;
end; end;
@ -1699,14 +1695,14 @@ end;
procedure TSQLTransaction.Commit; procedure TSQLTransaction.Commit;
begin begin
if active then if Active then
begin begin
closedatasets; CloseDataSets;
If LogEvent(detCommit) then If LogEvent(detCommit) then
Log(detCommit,SCommitting); Log(detCommit,SCommitting);
if SQLConnection.commit(FTrans) then if SQLConnection.Commit(FTrans) then
begin begin
closeTrans; CloseTrans;
FreeAndNil(FTrans); FreeAndNil(FTrans);
end; end;
end; end;
@ -1714,19 +1710,19 @@ end;
procedure TSQLTransaction.CommitRetaining; procedure TSQLTransaction.CommitRetaining;
begin begin
if active then if Active then
begin begin
If LogEvent(detCommit) then If LogEvent(detCommit) then
Log(detCommit,SCommitRetaining); Log(detCommit,SCommitRetaining);
SQLConnection.commitRetaining(FTrans); SQLConnection.CommitRetaining(FTrans);
end; end;
end; end;
procedure TSQLTransaction.Rollback; procedure TSQLTransaction.Rollback;
begin begin
if active then if Active then
begin begin
closedatasets; CloseDataSets;
If LogEvent(detRollback) then If LogEvent(detRollback) then
Log(detRollback,SRollingBack); Log(detRollback,SRollingBack);
if SQLConnection.RollBack(FTrans) then if SQLConnection.RollBack(FTrans) then
@ -1739,7 +1735,7 @@ end;
procedure TSQLTransaction.RollbackRetaining; procedure TSQLTransaction.RollbackRetaining;
begin begin
if active then if Active then
begin begin
If LogEvent(detRollback) then If LogEvent(detRollback) then
Log(detRollback,SRollBackRetaining); Log(detRollback,SRollBackRetaining);
@ -1771,7 +1767,7 @@ constructor TSQLTransaction.Create(AOwner : TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
FParams := TStringList.Create; FParams := TStringList.Create;
Action:=caRollBack; Action := caRollBack;
end; end;
destructor TSQLTransaction.Destroy; destructor TSQLTransaction.Destroy;