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

Comparing ibx/trunk/runtime/IBServices.pas (file contents):
Revision 45 by tony, Tue Dec 6 10:33:46 2016 UTC vs.
Revision 80 by tony, Mon Jan 1 11:31:07 2018 UTC

# Line 102 | Line 102 | type
102    TIBCustomService = class(TComponent)
103    private
104      FParamsChanged : Boolean;
105    FQueryParams: String;
105      FSPB : ISPB;
106      FSRB: ISRB;
107      FSQPB: ISQPB;
# Line 113 | Line 112 | type
112      FService: IServiceManager;
113      FStreamedActive  : Boolean;
114      FOnAttach: TNotifyEvent;
116    FOutputBufferOption: TOutputBufferOption;
115      FProtocol: TProtocol;
116      FParams: TStrings;
117      FServiceQueryResults: IServiceQueryResults;
# Line 151 | Line 149 | type
149      destructor Destroy; override;
150      procedure Attach;
151      procedure Detach;
152 +
153 +    {Copies database parameters as give in the DBParams to the Service
154 +      omitting any parameters not appropriate for TIBService. Typically, the
155 +      DBParams are TIBDatabase.Params}
156 +    procedure SetDBParams(DBParams: TStrings);
157 +
158      property ServiceIntf: IServiceManager read FService write SetService;
159      property ServiceParamBySPB[const Idx: Integer]: String read GetServiceParamBySPB
160                                                        write SetServiceParamBySPB;
# Line 694 | Line 698 | begin
698    MonitorHook.ServiceDetach(Self);
699   end;
700  
701 + procedure TIBCustomService.SetDBParams(DBParams: TStrings);
702 + var i: integer;
703 +    j: integer;
704 +    k: integer;
705 +    ParamName: string;
706 + begin
707 +  Params.Clear;
708 +  for i := 0 to DBParams.Count - 1 do
709 +  begin
710 +    ParamName := DBParams[i];
711 +    k := Pos('=',ParamName);
712 +    if k > 0 then system.Delete(ParamName,k,Length(ParamName)-k+1);
713 +    for j := 1 to isc_spb_last_spb_constant do
714 +      if ParamName = SPBConstantNames[j] then
715 +      begin
716 +        Params.Add(DBParams[i]);
717 +        break;
718 +      end;
719 +  end;
720 + end;
721 +
722   function TIBCustomService.GetActive: Boolean;
723   begin
724    result := FService <> nil;
# Line 740 | Line 765 | end;
765  
766   procedure TIBCustomService.InternalServiceQuery;
767   begin
768 +  CheckActive;
769    FServiceQueryResults := FService.Query(FSQPB,FSRB);
770    FSQPB := nil;
771    FSRB := nil;
# Line 981 | Line 1007 | begin
1007  
1008          for j := 0 to Count - 1 do
1009          begin
1010 <          FConfigParams.ConfigFileData.ConfigFileKey[j] := getItemType;
1011 <          FConfigParams.ConfigFileData.ConfigFileValue[j] := AsInteger;
1010 >          FConfigParams.ConfigFileData.ConfigFileKey[j] := Items[j].getItemType;
1011 >          FConfigParams.ConfigFileData.ConfigFileValue[j] := Items[j].AsInteger;
1012          end;
1013        end;
1014  
# Line 1211 | Line 1237 | begin
1237    SRB.Add(isc_spb_dbname).AsString :=  FDatabaseName;
1238    with SRB.Add(isc_spb_prp_write_mode) do
1239    if Value then
1240 <    AsInteger := isc_spb_prp_wm_async
1240 >    AsByte := isc_spb_prp_wm_async
1241    else
1242 <    AsInteger := isc_spb_prp_wm_sync;
1242 >    AsByte := isc_spb_prp_wm_sync;
1243    InternalServiceStart;
1244   end;
1245  
# Line 1236 | Line 1262 | begin
1262    SRB.Add(isc_spb_dbname).AsString :=  FDatabaseName;
1263    with SRB.Add(isc_spb_prp_access_mode) do
1264    if Value then
1265 <    AsInteger := isc_spb_prp_am_readonly
1265 >    AsByte := isc_spb_prp_am_readonly
1266    else
1267 <    AsInteger := isc_spb_prp_am_readwrite;
1267 >    AsByte := isc_spb_prp_am_readwrite;
1268    InternalServiceStart;
1269   end;
1270  
# Line 1248 | Line 1274 | begin
1274    SRB.Add(isc_spb_dbname).AsString :=  FDatabaseName;
1275    with SRB.Add(isc_spb_prp_reserve_space) do
1276    if Value then
1277 <    AsInteger := isc_spb_prp_res
1277 >    AsByte := isc_spb_prp_res
1278    else
1279 <    AsInteger := isc_spb_prp_res_use_full;
1279 >    AsByte := isc_spb_prp_res_use_full;
1280    InternalServiceStart;
1281   end;
1282  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines