43 |
|
type |
44 |
|
{ TFBServiceManager } |
45 |
|
|
46 |
+ |
{ TFB30ServiceManager } |
47 |
+ |
|
48 |
|
TFB30ServiceManager = class(TFBServiceManager,IServiceManager) |
49 |
|
private |
50 |
|
FServiceIntf: Firebird.IService; |
59 |
|
{IServiceManager} |
60 |
|
procedure Detach(Force: boolean=false); override; |
61 |
|
function IsAttached: boolean; |
62 |
< |
procedure Start(Request: ISRB); |
63 |
< |
function Query(SQPB: ISQPB; Request: ISRB): IServiceQueryResults; override; |
62 |
> |
function Start(Request: ISRB; RaiseExceptionOnError: boolean=true): boolean; |
63 |
> |
function Query(SQPB: ISQPB; Request: ISRB; RaiseExceptionOnError: boolean=true): IServiceQueryResults; override; |
64 |
|
end; |
65 |
|
|
66 |
|
implementation |
117 |
|
Result := FServiceIntf <> nil; |
118 |
|
end; |
119 |
|
|
120 |
< |
procedure TFB30ServiceManager.Start(Request: ISRB); |
120 |
> |
function TFB30ServiceManager.Start(Request: ISRB; RaiseExceptionOnError: boolean |
121 |
> |
): boolean; |
122 |
|
begin |
123 |
+ |
Result := true; |
124 |
|
CheckActive; |
125 |
|
with Firebird30ClientAPI do |
126 |
|
begin |
127 |
|
FServiceIntf.Start(StatusIntf, |
128 |
|
(Request as TSRB).getDataLength, |
129 |
|
BytePtr((Request as TSRB).getBuffer)); |
130 |
< |
Check4DataBaseError; |
130 |
> |
if RaiseExceptionOnError then |
131 |
> |
Check4DataBaseError |
132 |
> |
else |
133 |
> |
Result := not InErrorState; |
134 |
|
end; |
135 |
|
end; |
136 |
|
|
137 |
< |
function TFB30ServiceManager.Query(SQPB: ISQPB; Request: ISRB |
138 |
< |
): IServiceQueryResults; |
137 |
> |
function TFB30ServiceManager.Query(SQPB: ISQPB; Request: ISRB; |
138 |
> |
RaiseExceptionOnError: boolean): IServiceQueryResults; |
139 |
|
var QueryResults: TServiceQueryResults; |
140 |
|
begin |
141 |
|
CheckActive; |
152 |
|
BytePtr((Request as TSRB).getBuffer), |
153 |
|
QueryResults.getBufSize, |
154 |
|
BytePtr(QueryResults.Buffer)); |
155 |
< |
Check4DataBaseError; |
155 |
> |
if RaiseExceptionOnError then |
156 |
> |
Check4DataBaseError |
157 |
> |
else |
158 |
> |
if InErrorState then |
159 |
> |
Result := nil; |
160 |
|
end |
161 |
|
else |
162 |
< |
FServiceIntf.query(StatusIntf, 0, nil, |
162 |
> |
begin |
163 |
> |
FServiceIntf.query(StatusIntf, 0, nil, |
164 |
|
(Request as TSRB).getDataLength, |
165 |
|
BytePtr((Request as TSRB).getBuffer), |
166 |
|
QueryResults.getBufSize, |
167 |
|
BytePtr(QueryResults.Buffer)); |
168 |
< |
Check4DataBaseError; |
168 |
> |
if RaiseExceptionOnError then |
169 |
> |
Check4DataBaseError |
170 |
> |
else |
171 |
> |
if InErrorState then |
172 |
> |
Result := nil; |
173 |
> |
end; |
174 |
|
end; |
175 |
|
end; |
176 |
|
|