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

Comparing ibx/branches/udr/client/FBClientAPI.pas (file contents):
Revision 379 by tony, Mon Jan 10 10:08:03 2022 UTC vs.
Revision 390 by tony, Sat Jan 22 16:15:12 2022 UTC

# Line 115 | Line 115 | type
115  
116    { TFBStatus }
117  
118 <  TFBStatus = class(TFBInterfacedObject)
118 >  TFBStatus = class(TFBInterfacedObject, IStatus)
119    private
120      FIBDataBaseErrorMessages: TIBDataBaseErrorMessages;
121      FPrefix: AnsiString;
122 +    function SQLCodeSupported: boolean;
123    protected
124      FOwner: TFBClientAPI;
125      function GetIBMessage: Ansistring; virtual; abstract;
126      function GetSQLMessage: Ansistring;
127    public
128      constructor Create(aOwner: TFBClientAPI; prefix: AnsiString='');
129 +    constructor Copy(src: TFBStatus);
130      function StatusVector: PStatusVector; virtual; abstract;
131 +    function Clone: IStatus; virtual; abstract;
132  
133      {IStatus}
134 +    function InErrorState: boolean; virtual; abstract;
135      function GetIBErrorCode: TStatusCode;
136      function Getsqlcode: TStatusCode;
137      function GetMessage: AnsiString;
# Line 247 | Line 251 | type
251      IJournallingHook = interface
252        ['{7d3e45e0-3628-416a-9e22-c20474825031}']
253        procedure TransactionStart(Tr: ITransaction);
254 <      function TransactionEnd(TransactionID: integer; Action: TTransactionAction): boolean;
254 >      function TransactionEnd(TransactionID: integer; Completion: TTrCompletionState): boolean;
255        procedure TransactionRetained(Tr: ITransaction; OldTransactionID: integer; Action: TTransactionAction);
256        procedure ExecQuery(Stmt: IStatement);
257 +      procedure ExecImmediateJnl(sql: AnsiString; tr: ITransaction);
258      end;
259  
260   implementation
# Line 612 | Line 617 | end;
617  
618   { TFBStatus }
619  
620 + function TFBStatus.SQLCodeSupported: boolean;
621 + begin
622 +  Result:= (FOwner <> nil) and assigned(FOwner.isc_sqlcode) and  assigned(FOwner.isc_sql_interprete);
623 + end;
624 +
625   function TFBStatus.GetSQLMessage: Ansistring;
626   var local_buffer: array[0..IBHugeLocalBufferLength - 1] of AnsiChar;
627   begin
# Line 628 | Line 638 | begin
638    inherited Create;
639    FOwner := aOwner;
640    FPrefix := prefix;
641 <  FIBDataBaseErrorMessages := [ShowSQLCode, ShowSQLMessage, ShowIBMessage];
641 >  FIBDataBaseErrorMessages := [ShowIBMessage];
642 > end;
643 >
644 > constructor TFBStatus.Copy(src: TFBStatus);
645 > begin
646 >  inherited Create;
647 >  FOwner := src.FOwner;
648 >  FPrefix := src.FPrefix;
649 >  SetIBDataBaseErrorMessages(src.GetIBDataBaseErrorMessages);
650   end;
651  
652   function TFBStatus.GetIBErrorCode: TStatusCode;
# Line 649 | Line 667 | var IBDataBaseErrorMessages: TIBDataBase
667   begin
668    Result := FPrefix;
669    IBDataBaseErrorMessages := FIBDataBaseErrorMessages;
670 <  if (ShowSQLCode in IBDataBaseErrorMessages) then
653 <    Result := Result + 'SQLCODE: ' + IntToStr(Getsqlcode); {do not localize}
654 <
655 <  if [ShowSQLMessage, ShowIBMessage]*IBDataBaseErrorMessages <> [] then
670 >  if SQLCodeSupported then
671    begin
672 <    if (ShowSQLCode in FIBDataBaseErrorMessages) then
673 <      Result := Result + LineEnding;
659 <    Result := Result + 'Engine Code: ' + IntToStr(GetIBErrorCode) + ' ';
660 <  end;
672 >    if (ShowSQLCode in IBDataBaseErrorMessages) then
673 >      Result := Result + 'SQLCODE: ' + IntToStr(Getsqlcode); {do not localize}
674  
675 <  if (ShowSQLMessage in IBDataBaseErrorMessages) then
676 <    Result := Result + GetSQLMessage;
675 >    if (ShowSQLMessage in IBDataBaseErrorMessages) then
676 >    begin
677 >      if ShowSQLCode in IBDataBaseErrorMessages then
678 >        Result := Result + LineEnding;
679 >      Result := Result + GetSQLMessage;
680 >    end;
681 >  end;
682  
683    if (ShowIBMessage in IBDataBaseErrorMessages) then
684    begin
685 <    if ShowSQLMessage in IBDataBaseErrorMessages then
685 >    if Result <> FPrefix then
686        Result := Result + LineEnding;
687 <    Result := Result + GetIBMessage;
687 >    Result := Result + 'Engine Code: ' + IntToStr(GetIBErrorCode) + LineEnding + GetIBMessage;
688    end;
689    if (Result <> '') and (Result[Length(Result)] = '.') then
690      Delete(Result, Length(Result), 1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines