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; |
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; |
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; |
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; |
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; |
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; |
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; |