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 |
+ |
procedure SetInterface(api: TFBClientAPI); override; |
89 |
|
public |
90 |
|
property Handle: TISC_TR_HANDLE read FHandle; |
91 |
|
|
111 |
|
Result := (att as TFB25Attachment); |
112 |
|
end; |
113 |
|
|
114 |
+ |
procedure TFB25Transaction.SetInterface(api: TFBClientAPI); |
115 |
+ |
begin |
116 |
+ |
inherited SetInterface(api); |
117 |
+ |
FFirebird25ClientAPI := api as TFB25ClientAPI; |
118 |
+ |
OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError; |
119 |
+ |
end; |
120 |
+ |
|
121 |
|
function TFB25Transaction.GetInTransaction: boolean; |
122 |
|
begin |
123 |
|
Result := FHandle <> nil; |
129 |
|
IBError(ibxeNotAMultiDatabaseTransaction,[nil]); |
130 |
|
if FHandle = nil then |
131 |
|
Exit; |
132 |
< |
with Firebird25ClientAPI do |
132 |
> |
with FFirebird25ClientAPI do |
133 |
|
Call(isc_prepare_transaction(StatusVector, @FHandle)); |
134 |
|
end; |
135 |
|
|
137 |
|
begin |
138 |
|
if FHandle = nil then |
139 |
|
Exit; |
140 |
< |
with Firebird25ClientAPI do |
140 |
> |
with FFirebird25ClientAPI do |
141 |
|
Call(isc_commit_transaction(StatusVector, @FHandle),not Force); |
142 |
|
FHandle := nil; |
143 |
|
end; |
146 |
|
begin |
147 |
|
if FHandle = nil then |
148 |
|
Exit; |
149 |
< |
with Firebird25ClientAPI do |
149 |
> |
with FFirebird25ClientAPI do |
150 |
|
Call(isc_commit_retaining(StatusVector, @FHandle)); |
151 |
|
end; |
152 |
|
|
159 |
|
Exit; |
160 |
|
pteb := nil; |
161 |
|
FDefaultCompletion := DefaultCompletion; |
162 |
< |
with Firebird25ClientAPI do |
162 |
> |
with FFirebird25ClientAPI do |
163 |
|
if (Length(FAttachments) = 1) then |
164 |
|
try |
165 |
|
db_handle := (FAttachments[0] as TFB25Attachment).Handle; |
198 |
|
begin |
199 |
|
if FHandle = nil then |
200 |
|
Exit; |
201 |
< |
with Firebird25ClientAPI do |
201 |
> |
with FFirebird25ClientAPI do |
202 |
|
Call(isc_rollback_transaction(StatusVector, @FHandle),not Force); |
203 |
|
FHandle := nil; |
204 |
|
end; |
207 |
|
begin |
208 |
|
if FHandle = nil then |
209 |
|
Exit; |
210 |
< |
with Firebird25ClientAPI do |
210 |
> |
with FFirebird25ClientAPI do |
211 |
|
Call(isc_rollback_retaining(StatusVector, @FHandle)); |
212 |
|
end; |
213 |
|
|