47 |
|
TFB30Transaction = class(TFBTransaction,ITransaction, IActivityMonitor) |
48 |
|
private |
49 |
|
FTransactionIntf: Firebird.ITransaction; |
50 |
+ |
FFirebird30ClientAPI: TFB30ClientAPI; |
51 |
|
procedure StartMultiple; |
52 |
|
procedure FreeHandle; |
53 |
|
protected |
54 |
|
function GetActivityIntf(att: IAttachment): IActivityMonitor; override; |
55 |
+ |
procedure SetInterface(api: TFBClientAPI); override; |
56 |
|
public |
57 |
|
destructor Destroy; override; |
58 |
|
property TransactionIntf: Firebird.ITransaction read FTransactionIntf; |
78 |
|
DtcStart: IDtcStart; |
79 |
|
i: integer; |
80 |
|
begin |
81 |
< |
with Firebird30ClientAPI do |
81 |
> |
with FFirebird30ClientAPI do |
82 |
|
begin |
83 |
|
Dtc := MasterIntf.getDtc; |
84 |
|
DtcStart := Dtc.startBuilder(StatusIntf); |
110 |
|
Result := att as TFB30Attachment; |
111 |
|
end; |
112 |
|
|
113 |
+ |
procedure TFB30Transaction.SetInterface(api: TFBClientAPI); |
114 |
+ |
begin |
115 |
+ |
inherited SetInterface(api); |
116 |
+ |
FFirebird30ClientAPI := api as TFB30ClientAPI; |
117 |
+ |
end; |
118 |
+ |
|
119 |
|
destructor TFB30Transaction.Destroy; |
120 |
|
begin |
121 |
|
inherited Destroy; |
133 |
|
IBError(ibxeNotAMultiDatabaseTransaction,[nil]); |
134 |
|
if FTransactionIntf = nil then |
135 |
|
Exit; |
136 |
< |
with Firebird30ClientAPI do |
136 |
> |
with FFirebird30ClientAPI do |
137 |
|
begin |
138 |
|
FTransactionIntf.prepare(StatusIntf,0,nil); |
139 |
|
Check4DataBaseError; |
145 |
|
begin |
146 |
|
if FTransactionIntf = nil then |
147 |
|
Exit; |
148 |
< |
with Firebird30ClientAPI do |
148 |
> |
with FFirebird30ClientAPI do |
149 |
|
begin |
150 |
|
FTransactionIntf.commit(StatusIntf); |
151 |
|
if not Force and InErrorState then |
159 |
|
begin |
160 |
|
if FTransactionIntf = nil then |
161 |
|
Exit; |
162 |
< |
with Firebird30ClientAPI do |
162 |
> |
with FFirebird30ClientAPI do |
163 |
|
begin |
164 |
|
FTransactionIntf.commitRetaining(StatusIntf); |
165 |
|
Check4DataBaseError; |
171 |
|
begin |
172 |
|
if FTransactionIntf <> nil then |
173 |
|
Exit; |
166 |
– |
|
174 |
|
FDefaultCompletion := DefaultCompletion; |
175 |
|
|
176 |
|
if Length(FAttachments) = 1 then |
177 |
< |
with Firebird30ClientAPI do |
177 |
> |
with FFirebird30ClientAPI do |
178 |
|
begin |
179 |
|
FTransactionIntf := (FAttachments[0] as TFB30Attachment).AttachmentIntf.startTransaction(StatusIntf, |
180 |
|
(FTPB as TTPB).getDataLength,BytePtr((FTPB as TTPB).getBuffer)); |
190 |
|
begin |
191 |
|
if FTransactionIntf = nil then |
192 |
|
Exit; |
193 |
< |
with Firebird30ClientAPI do |
193 |
> |
with FFirebird30ClientAPI do |
194 |
|
begin |
195 |
|
FTransactionIntf.rollback(StatusIntf); |
196 |
|
if not Force and InErrorState then |
204 |
|
begin |
205 |
|
if FTransactionIntf = nil then |
206 |
|
Exit; |
207 |
< |
with Firebird30ClientAPI do |
207 |
> |
with FFirebird30ClientAPI do |
208 |
|
begin |
209 |
|
FTransactionIntf.rollbackRetaining(StatusIntf); |
210 |
|
Check4DataBaseError; |