ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/FBTransaction.pas
(Generate patch)

Comparing ibx/branches/udr/client/FBTransaction.pas (file contents):
Revision 386 by tony, Mon Jan 10 10:08:03 2022 UTC vs.
Revision 387 by tony, Wed Jan 19 13:34:42 2022 UTC

# Line 96 | Line 96 | type
96      function GetTrInfo(ReqBuffer: PByte; ReqBufLen: integer): ITrInformation; virtual; abstract;
97      procedure InternalStartSingle(attachment: IAttachment); virtual; abstract;
98      procedure InternalStartMultiple; virtual; abstract;
99 <    procedure InternalCommit(Force: boolean); virtual; abstract;
99 >    function InternalCommit(Force: boolean): TTrCompletionState; virtual; abstract;
100      procedure InternalCommitRetaining; virtual; abstract;
101 <    procedure InternalRollback(Force: boolean); virtual; abstract;
101 >    function InternalRollback(Force: boolean): TTrCompletionState; virtual; abstract;
102      procedure InternalRollbackRetaining; virtual; abstract;
103    public
104      constructor Create(api: TFBClientAPI; Attachments: array of IAttachment; Params: array of byte; DefaultCompletion: TTransactionAction; aName: AnsiString); overload;
# Line 113 | Line 113 | type
113      {ITransaction}
114      function getTPB: ITPB;
115      procedure PrepareForCommit;virtual; abstract;
116 <    procedure Commit(Force: boolean=false);
116 >    function Commit(Force: boolean=false): TTrCompletionState;
117      procedure CommitRetaining;
118      function GetInTransaction: boolean; virtual; abstract;
119      function GetIsReadOnly: boolean;
# Line 122 | Line 122 | type
122      function GetAttachment(index: integer): IAttachment;
123      function GetJournalingActive(attachment: IAttachment): boolean;
124      function GetDefaultCompletion: TTransactionCompletion;
125 <    procedure Rollback(Force: boolean=false);
125 >    function Rollback(Force: boolean=false): TTrCompletionState;
126      procedure RollbackRetaining;
127      procedure Start(DefaultCompletion: TTransactionCompletion=taCommit); overload;
128      procedure Start(TPB: ITPB; DefaultCompletion: TTransactionCompletion=taCommit); overload;
# Line 336 | Line 336 | begin
336    Result := FTPB;
337   end;
338  
339 < procedure TFBTransaction.Commit(Force: boolean);
339 > function TFBTransaction.Commit(Force: boolean): TTrCompletionState;
340   var i: integer;
341      TransactionID: integer;
342      TransactionEndNeeded: array of boolean;
# Line 353 | Line 353 | begin
353        TransactionEndNeeded[i] := GetJournalingActive(FAttachments[i])
354      else
355        TransactionEndNeeded[i] := false;
356 <  InternalCommit(Force);
356 >  Result := InternalCommit(Force);
357    for i := 0 to Length(FAttachments) - 1 do
358      if TransactionEndNeeded[i] then
359 <       GetJournalIntf(FAttachments[i]).TransactionEnd(TransactionID, TACommit);
359 >       GetJournalIntf(FAttachments[i]).TransactionEnd(TransactionID, Result);
360   end;
361  
362   procedure TFBTransaction.CommitRetaining;
# Line 421 | Line 421 | begin
421    Result := FDefaultCompletion;
422   end;
423  
424 < procedure TFBTransaction.Rollback(Force: boolean);
424 > function TFBTransaction.Rollback(Force: boolean): TTrCompletionState;
425   var i: integer;
426      TransactionID: integer;
427      TransactionEndNeeded: array of boolean;
# Line 438 | Line 438 | begin
438        TransactionEndNeeded[i] := GetJournalingActive(FAttachments[i])
439      else
440        TransactionEndNeeded[i] := false;
441 <  InternalRollback(Force);
441 >  Result := InternalRollback(Force);
442    for i := 0 to Length(FAttachments) - 1 do
443      if TransactionEndNeeded[i] then
444 <       GetJournalIntf(FAttachments[i]).TransactionEnd(TransactionID, TARollback);
444 >       GetJournalIntf(FAttachments[i]).TransactionEnd(TransactionID, Result);
445   end;
446  
447   procedure TFBTransaction.RollbackRetaining;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines