82 |
|
TFB25Transaction = class(TFBTransaction,ITransaction, IActivityMonitor) |
83 |
|
private |
84 |
|
FHandle: TISC_TR_HANDLE; |
85 |
+ |
FFirebird25ClientAPI: TFB25ClientAPI; |
86 |
|
protected |
87 |
|
function GetActivityIntf(att: IAttachment): IActivityMonitor; override; |
88 |
+ |
function GetTrInfo(ReqBuffer: PByte; ReqBufLen: integer): ITrInformation; override; |
89 |
+ |
procedure SetInterface(api: TFBClientAPI); override; |
90 |
|
public |
91 |
|
property Handle: TISC_TR_HANDLE read FHandle; |
92 |
|
|
112 |
|
Result := (att as TFB25Attachment); |
113 |
|
end; |
114 |
|
|
115 |
+ |
function TFB25Transaction.GetTrInfo(ReqBuffer: PByte; ReqBufLen: integer |
116 |
+ |
): ITrInformation; |
117 |
+ |
begin |
118 |
+ |
Result := TTrInformation.Create(FFirebird25ClientAPI); |
119 |
+ |
with FFirebird25ClientAPI, Result as TTrInformation do |
120 |
+ |
if isc_transaction_info(StatusVector, @(FHandle), ReqBufLen, ReqBuffer, |
121 |
+ |
getBufSize, Buffer) > 0 then |
122 |
+ |
IBDataBaseError; |
123 |
+ |
end; |
124 |
+ |
|
125 |
+ |
procedure TFB25Transaction.SetInterface(api: TFBClientAPI); |
126 |
+ |
begin |
127 |
+ |
inherited SetInterface(api); |
128 |
+ |
FFirebird25ClientAPI := api as TFB25ClientAPI; |
129 |
+ |
OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError; |
130 |
+ |
end; |
131 |
+ |
|
132 |
|
function TFB25Transaction.GetInTransaction: boolean; |
133 |
|
begin |
134 |
|
Result := FHandle <> nil; |
140 |
|
IBError(ibxeNotAMultiDatabaseTransaction,[nil]); |
141 |
|
if FHandle = nil then |
142 |
|
Exit; |
143 |
< |
with Firebird25ClientAPI do |
143 |
> |
with FFirebird25ClientAPI do |
144 |
|
Call(isc_prepare_transaction(StatusVector, @FHandle)); |
145 |
|
end; |
146 |
|
|
148 |
|
begin |
149 |
|
if FHandle = nil then |
150 |
|
Exit; |
151 |
< |
with Firebird25ClientAPI do |
151 |
> |
with FFirebird25ClientAPI do |
152 |
|
Call(isc_commit_transaction(StatusVector, @FHandle),not Force); |
153 |
|
FHandle := nil; |
154 |
|
end; |
157 |
|
begin |
158 |
|
if FHandle = nil then |
159 |
|
Exit; |
160 |
< |
with Firebird25ClientAPI do |
160 |
> |
with FFirebird25ClientAPI do |
161 |
|
Call(isc_commit_retaining(StatusVector, @FHandle)); |
162 |
|
end; |
163 |
|
|
170 |
|
Exit; |
171 |
|
pteb := nil; |
172 |
|
FDefaultCompletion := DefaultCompletion; |
173 |
< |
with Firebird25ClientAPI do |
173 |
> |
with FFirebird25ClientAPI do |
174 |
|
if (Length(FAttachments) = 1) then |
175 |
|
try |
176 |
|
db_handle := (FAttachments[0] as TFB25Attachment).Handle; |
209 |
|
begin |
210 |
|
if FHandle = nil then |
211 |
|
Exit; |
212 |
< |
with Firebird25ClientAPI do |
212 |
> |
with FFirebird25ClientAPI do |
213 |
|
Call(isc_rollback_transaction(StatusVector, @FHandle),not Force); |
214 |
|
FHandle := nil; |
215 |
|
end; |
218 |
|
begin |
219 |
|
if FHandle = nil then |
220 |
|
Exit; |
221 |
< |
with Firebird25ClientAPI do |
221 |
> |
with FFirebird25ClientAPI do |
222 |
|
Call(isc_rollback_retaining(StatusVector, @FHandle)); |
223 |
|
end; |
224 |
|
|