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

Comparing ibx/branches/journaling/fbintf/client/2.5/FB25Attachment.pas (file contents):
Revision 362 by tony, Tue Dec 7 13:27:39 2021 UTC vs.
Revision 363 by tony, Tue Dec 7 13:30:05 2021 UTC

# Line 49 | Line 49 | type
49      FFirebird25ClientAPI: TFB25ClientAPI;
50    protected
51      procedure CheckHandle; override;
52 +    function GetAttachment: IAttachment; override;
53    public
54      constructor Create(api: TFB25ClientAPI; DatabaseName: AnsiString; aDPB: IDPB;
55        RaiseExceptionOnConnectError: boolean);
# Line 65 | Line 66 | type
66      procedure Disconnect(Force: boolean=false); override;
67      function IsConnected: boolean; override;
68      procedure DropDatabase;
69 <    function StartTransaction(TPB: array of byte; DefaultCompletion: TTransactionCompletion): ITransaction; override;
70 <    function StartTransaction(TPB: ITPB; DefaultCompletion: TTransactionCompletion): ITransaction; override;
69 >    function StartTransaction(TPB: array of byte; DefaultCompletion: TTransactionCompletion; aName: AnsiString): ITransaction; override;
70 >    function StartTransaction(TPB: ITPB; DefaultCompletion: TTransactionCompletion; aName: AnsiString): ITransaction; override;
71      procedure ExecImmediate(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer); override;
72      function Prepare(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer; CursorName: AnsiString=''): IStatement; override;
73      function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString;
# Line 105 | Line 106 | begin
106      IBError(ibxeDatabaseClosed,[nil]);
107   end;
108  
109 + function TFB25Attachment.GetAttachment: IAttachment;
110 + begin
111 +  Result := self;
112 + end;
113 +
114   constructor TFB25Attachment.Create(api: TFB25ClientAPI; DatabaseName: AnsiString; aDPB: IDPB;
115    RaiseExceptionOnConnectError: boolean);
116   begin
# Line 197 | Line 203 | end;
203  
204   procedure TFB25Attachment.Disconnect(Force: boolean);
205   begin
206 +  inherited Disconnect(Force);
207    if FHandle = nil then
208      Exit;
209  
# Line 218 | Line 225 | end;
225  
226   procedure TFB25Attachment.DropDatabase;
227   begin
228 <  CheckHandle;
229 <  EndAllTransactions;
230 <  with FFirebird25ClientAPI do
231 <    if isc_drop_database(StatusVector, @FHandle) > 0 then
232 <      IBDatabaseError;
233 <  FHandle := nil;
228 >  if IsConnected then
229 >  begin
230 >    EndAllTransactions;
231 >    EndSession(false);
232 >    with FFirebird25ClientAPI do
233 >      if isc_drop_database(StatusVector, @FHandle) > 0 then
234 >        IBDatabaseError;
235 >    FHandle := nil;
236 >  end;
237   end;
238  
239   function TFB25Attachment.StartTransaction(TPB: array of byte;
240 <  DefaultCompletion: TTransactionCompletion): ITransaction;
240 >  DefaultCompletion: TTransactionCompletion; aName: AnsiString): ITransaction;
241   begin
242    CheckHandle;
243 <  Result := TFB25Transaction.Create(FFirebird25ClientAPI,self,TPB,DefaultCompletion);
243 >  Result := TFB25Transaction.Create(FFirebird25ClientAPI,self,TPB,DefaultCompletion,aName);
244   end;
245  
246   function TFB25Attachment.StartTransaction(TPB: ITPB;
247 <  DefaultCompletion: TTransactionCompletion): ITransaction;
247 >  DefaultCompletion: TTransactionCompletion; aName: AnsiString): ITransaction;
248   begin
249    CheckHandle;
250 <  Result := TFB25Transaction.Create(FFirebird25ClientAPI,self,TPB,DefaultCompletion);
250 >  Result := TFB25Transaction.Create(FFirebird25ClientAPI,self,TPB,DefaultCompletion,aName);
251   end;
252  
253   function TFB25Attachment.CreateBlob(transaction: ITransaction;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines