ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/client/2.5/FB25Services.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/2.5/FB25Services.pas (file contents):
Revision 208 by tony, Mon Mar 6 10:20:02 2017 UTC vs.
Revision 209 by tony, Wed Mar 14 12:48:51 2018 UTC

# Line 78 | Line 78 | uses
78   type
79    { TFBServiceManager }
80  
81 +  { TFB25ServiceManager }
82 +
83    TFB25ServiceManager = class(TFBServiceManager,IServiceManager)
84    private
85      FHandle: TISC_SVC_HANDLE;
# Line 92 | Line 94 | type
94      {IServiceManager}
95      procedure Detach(Force: boolean=false); override;
96      function IsAttached: boolean;
97 <    procedure Start(Request: ISRB);
98 <    function Query(SQPB: ISQPB; Request: ISRB): IServiceQueryResults; override;
97 >    function Start(Request: ISRB; RaiseExceptionOnError: boolean=true): boolean;
98 >    function Query(SQPB: ISQPB; Request: ISRB; RaiseExceptionOnError: boolean=true): IServiceQueryResults; override;
99    end;
100  
101   implementation
# Line 153 | Line 155 | begin
155    Result := FHandle <> nil;
156   end;
157  
158 < procedure TFB25ServiceManager.Start(Request: ISRB);
158 > function TFB25ServiceManager.Start(Request: ISRB; RaiseExceptionOnError: boolean
159 >  ): boolean;
160   begin
161 +  Result := true;
162    CheckActive;
163    with Firebird25ClientAPI do
164 <    if isc_service_start(StatusVector, @FHandle, nil,
164 >  begin
165 >    Result := isc_service_start(StatusVector, @FHandle, nil,
166                             (Request as TSRB).getDataLength,
167 <                           (Request as TSRB).getBuffer) > 0 then
168 <        IBDataBaseError;
167 >                           (Request as TSRB).getBuffer) = 0;
168 >    if not Result and RaiseExceptionOnError then
169 >      IBDataBaseError;
170 >  end;
171   end;
172  
173 < function TFB25ServiceManager.Query(SQPB: ISQPB; Request: ISRB
174 <  ): IServiceQueryResults;
173 > function TFB25ServiceManager.Query(SQPB: ISQPB; Request: ISRB;
174 >  RaiseExceptionOnError: boolean): IServiceQueryResults;
175   var QueryResults: TServiceQueryResults;
176   begin
177    CheckActive;
# Line 178 | Line 185 | begin
185                           (Request as TSRB).getBuffer,
186                           QueryResults.getBufSize,
187                           QueryResults.Buffer) > 0 then
188 <        IBDataBaseError;
188 >      begin
189 >        if RaiseExceptionOnError then
190 >          IBDataBaseError
191 >        else
192 >          Result := nil;
193 >      end;
194      end
195      else
196      if isc_service_query(StatusVector, @FHandle, nil,
# Line 188 | Line 200 | begin
200                         (Request as TSRB).getBuffer,
201                         QueryResults.getBufSize,
202                         QueryResults.Buffer) > 0 then
203 <      IBDataBaseError;
204 <
203 >    begin
204 >      if RaiseExceptionOnError then
205 >        IBDataBaseError
206 >      else
207 >        Result := nil;
208 >    end;
209   end;
210  
211   end.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines