52 |
|
{$ELSE} |
53 |
|
unix, |
54 |
|
{$ENDIF} |
55 |
< |
SysUtils, Classes, IBHeader, IB, IBExternals, CustApp, IBTypes, IBSQL; |
55 |
> |
SysUtils, Classes, IB, IBExternals, CustApp, IBTypes; |
56 |
|
|
57 |
|
const |
58 |
|
DefaultBufferSize = 32000; |
102 |
|
TIBCustomService = class(TComponent) |
103 |
|
private |
104 |
|
FParamsChanged : Boolean; |
105 |
– |
FQueryParams: String; |
105 |
|
FSPB : ISPB; |
106 |
|
FSRB: ISRB; |
107 |
|
FSQPB: ISQPB; |
112 |
|
FService: IServiceManager; |
113 |
|
FStreamedActive : Boolean; |
114 |
|
FOnAttach: TNotifyEvent; |
116 |
– |
FOutputBufferOption: TOutputBufferOption; |
115 |
|
FProtocol: TProtocol; |
116 |
|
FParams: TStrings; |
117 |
|
FServiceQueryResults: IServiceQueryResults; |
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; |
525 |
|
implementation |
526 |
|
|
527 |
|
uses |
528 |
< |
IBSQLMonitor, Math, FBMessages; |
528 |
> |
IBSQLMonitor, FBMessages; |
529 |
|
|
530 |
|
{ TIBBackupRestoreService } |
531 |
|
|
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; |
765 |
|
|
766 |
|
procedure TIBCustomService.InternalServiceQuery; |
767 |
|
begin |
768 |
+ |
CheckActive; |
769 |
|
FServiceQueryResults := FService.Query(FSQPB,FSRB); |
770 |
|
FSQPB := nil; |
771 |
|
FSRB := nil; |
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
1564 |
|
|
1565 |
|
var |
1566 |
|
i,j, k: Integer; |
1541 |
– |
Value: Char; |
1567 |
|
begin |
1568 |
|
for i := 0 to High(FLimboTransactionInfo) do |
1569 |
|
FLimboTransactionInfo[i].Free; |