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

Comparing ibx/branches/udr/udr/source/FBUDRUtils.pas (file contents):
Revision 371 by tony, Wed Jan 5 15:21:22 2022 UTC vs.
Revision 374 by tony, Sun Jan 9 23:39:28 2022 UTC

# Line 85 | Line 85 | type
85      FAttachment: IAttachment;
86      FTransaction: ITransaction;
87    public
88 <    procedure Assign(src: Firebird.IExternalContext);
88 >    constructor Create(aController: TFBUDRController; context: Firebird.IExternalContext);
89      function AsText: AnsiString;
90    public
91      {IFBUDRExternalContext}
# Line 247 | Line 247 | begin
247      Result := ValTrue
248    else
249      Result := ValFalse;
250 < end;
251 <
250 > end;
251 >
252   { TFBUDRMessageMetadata }
253  
254   constructor TFBUDRMessageMetadata.Create(context: IFBUDRExternalContext;
# Line 549 | Line 549 | end;
549  
550   { TFBUDRExternalContext }
551  
552 < procedure TFBUDRExternalContext.Assign(src: Firebird.IExternalContext);
553 <
554 <  function SameTransaction: boolean;
555 <  var tr1, tr2: Firebird.ITransaction;
556 <  begin
557 <    Result := false;
558 <    if FContext = nil then Exit;
559 <    tr1 := src.getTransaction(FStatus);
560 <    CheckStatus;
561 <    tr2 := FContext.getTransaction(FStatus);
562 <    CheckStatus;
563 <    Result := tr1 = tr2;
564 <  end;
565 <
566 <  function SameAttachment: boolean;
567 <  var at1, at2: Firebird.IAttachment;
568 <  begin
569 <    Result := false;
570 <    if FContext = nil then Exit;
571 <    at1 := src.getAttachment(FStatus);
572 <    CheckStatus;
573 <    at2 := FContext.getAttachment(FStatus);
574 <    CheckStatus;
575 <    Result := at1 = at2;
576 <  end;
577 <
552 > constructor TFBUDRExternalContext.Create(aController: TFBUDRController;
553 >  context: Firebird.IExternalContext);
554   begin
555 <  if src = FContext then Exit;
556 <
557 <  if src = nil then
582 <  begin
583 <    FirebirdAPI := nil;
584 <    FTransaction := nil;
585 <    FAttachment := nil;
586 <    FContext := nil;
587 <  end
588 <  else
589 <  begin
590 <    if (FContext = nil) or (src.getMaster() <> FContext.getMaster) then
591 <      FirebirdAPI := TFB30ClientAPI.Create(src.getMaster);
592 <
593 <    if not SameTransaction then
594 <      FTransaction := nil;
595 <
596 <    if not SameAttachment then
597 <      FAttachment := nil;
598 <
599 <    FContext := src;
600 <  end;
555 >  inherited Create(aController);
556 >  FContext := context;
557 >  FirebirdAPI := TFB30ClientAPI.Create(context.getMaster);
558   end;
559  
560   function TFBUDRExternalContext.AsText: AnsiString;
# Line 674 | Line 631 | end;
631  
632   function TFBUDRExternalContext.HasConfigFile: boolean;
633   begin
634 <
634 >  Result := Controller.HasConfigFile;
635   end;
636  
637   function TFBUDRExternalContext.ReadConfigString(Section, Ident,
638    DefaultValue: AnsiString): AnsiString;
639   begin
640 <  Result := FController.ReadConfigString(Section, Ident, DefaultValue);
640 >  Result := Controller.ReadConfigString(Section, Ident, DefaultValue);
641   end;
642  
643   function TFBUDRExternalContext.ReadConfigInteger(Section, Ident: AnsiString;
644    DefaultValue: integer): integer;
645   begin
646 <  Result := FController.ReadConfigInteger(Section, Ident, DefaultValue);
646 >  Result := Controller.ReadConfigInteger(Section, Ident, DefaultValue);
647   end;
648  
649   function TFBUDRExternalContext.ReadConfigBool(Section, Ident: AnsiString;
650    DefaultValue: boolean): boolean;
651   begin
652 <  Result := FController.ReadConfigBool(Section, Ident, DefaultValue);
652 >  Result := Controller.ReadConfigBool(Section, Ident, DefaultValue);
653   end;
654  
655   procedure TFBUDRExternalContext.WriteToLog(Msg: AnsiString);
656   begin
657 <  FController.WriteToLog(Msg);
657 >  Controller.WriteToLog(Msg);
658   end;
659  
660  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines