159 |
|
FHiddenPassword: string; |
160 |
|
FIBLoaded: Boolean; |
161 |
|
FOnLogin: TIBDatabaseLoginEvent; |
162 |
+ |
FSQLHourGlass: Boolean; |
163 |
|
FTraceFlags: TTraceFlags; |
164 |
|
FDBSQLDialect: Integer; |
165 |
|
FSQLDialect: Integer; |
263 |
|
write SetDefaultTransaction; |
264 |
|
property IdleTimer: Integer read GetIdleTimer write SetIdleTimer; |
265 |
|
property SQLDialect : Integer read GetSQLDialect write SetSQLDialect default 3; |
266 |
+ |
property SQLHourGlass: Boolean read FSQLHourGlass write FSQLHourGlass default true; |
267 |
|
property DBSQLDialect : Integer read FDBSQLDialect; |
268 |
|
property TraceFlags: TTraceFlags read FTraceFlags write FTraceFlags; |
269 |
|
property AfterConnect; |
281 |
|
|
282 |
|
TIBTransaction = class(TComponent) |
283 |
|
private |
284 |
+ |
FAfterTransactionEnd: TNotifyEvent; |
285 |
+ |
FBeforeTransactionEnd: TNotifyEvent; |
286 |
|
FIBLoaded: Boolean; |
287 |
|
FCanTimeout : Boolean; |
288 |
|
FDatabases : TList; |
299 |
|
FTRParams : TStrings; |
300 |
|
FTRParamsChanged : Boolean; |
301 |
|
FInEndTransaction : boolean; |
302 |
+ |
FEndAction : TTransactionAction; |
303 |
+ |
procedure DoBeforeTransactionEnd; |
304 |
+ |
procedure DoAfterTransactionEnd; |
305 |
|
procedure EnsureNotInTransaction; |
306 |
|
procedure EndTransaction(Action: TTransactionAction; Force: Boolean); |
307 |
|
function GetDatabase(Index: Integer): TIBDatabase; |
343 |
|
function AddDatabase(db: TIBDatabase): Integer; |
344 |
|
function FindDatabase(db: TIBDatabase): Integer; |
345 |
|
function FindDefaultDatabase: TIBDatabase; |
346 |
+ |
function GetEndAction: TTransactionAction; |
347 |
|
procedure RemoveDatabase(Idx: Integer); |
348 |
|
procedure RemoveDatabases; |
349 |
|
procedure CheckDatabasesInList; |
365 |
|
property DefaultAction: TTransactionAction read FDefaultAction write SetDefaultAction default taCommit; |
366 |
|
property Params: TStrings read FTRParams write SetTRParams; |
367 |
|
property OnIdleTimer: TNotifyEvent read FOnIdleTimer write FOnIdleTimer; |
368 |
+ |
property BeforeTransactionEnd: TNotifyEvent read FBeforeTransactionEnd |
369 |
+ |
write FBeforeTransactionEnd; |
370 |
+ |
property AfterTransactionEnd: TNotifyEvent read FAfterTransactionEnd |
371 |
+ |
write FAfterTransactionEnd; |
372 |
|
end; |
373 |
|
|
374 |
|
{ TIBBase } |
452 |
|
FTransactions := TList.Create; |
453 |
|
FDBName := ''; |
454 |
|
FDBParams := TStringList.Create; |
455 |
+ |
FSQLHourGlass := true; |
456 |
|
{$ifdef UNIX} |
457 |
|
if csDesigning in ComponentState then |
458 |
|
FDBParams.Add('lc_ctype=UTF-8'); |
1397 |
|
IBError(ibxeNotInTransaction, [nil]); |
1398 |
|
end; |
1399 |
|
|
1400 |
+ |
procedure TIBTransaction.DoBeforeTransactionEnd; |
1401 |
+ |
begin |
1402 |
+ |
if Assigned(FBeforeTransactionEnd) then |
1403 |
+ |
FBeforeTransactionEnd(self); |
1404 |
+ |
end; |
1405 |
+ |
|
1406 |
+ |
procedure TIBTransaction.DoAfterTransactionEnd; |
1407 |
+ |
begin |
1408 |
+ |
if Assigned(FAfterTransactionEnd) then |
1409 |
+ |
FAfterTransactionEnd(self); |
1410 |
+ |
end; |
1411 |
+ |
|
1412 |
|
procedure TIBTransaction.EnsureNotInTransaction; |
1413 |
|
begin |
1414 |
|
if csDesigning in ComponentState then |
1485 |
|
CheckInTransaction; |
1486 |
|
if FInEndTransaction then Exit; |
1487 |
|
FInEndTransaction := true; |
1488 |
+ |
FEndAction := Action; |
1489 |
|
try |
1490 |
|
case Action of |
1491 |
|
TARollback, TACommit: |
1494 |
|
(Action <> FDefaultAction) and |
1495 |
|
(not Force) then |
1496 |
|
IBError(ibxeCantEndSharedTransaction, [nil]); |
1497 |
+ |
DoBeforeTransactionEnd; |
1498 |
|
for i := 0 to FSQLObjects.Count - 1 do if FSQLObjects[i] <> nil then |
1499 |
|
SQLObjects[i].DoBeforeTransactionEnd; |
1500 |
|
if InTransaction then |
1519 |
|
IBDataBaseError; |
1520 |
|
for i := 0 to FSQLObjects.Count - 1 do if FSQLObjects[i] <> nil then |
1521 |
|
SQLObjects[i].DoAfterTransactionEnd; |
1522 |
+ |
DoAfterTransactionEnd; |
1523 |
|
end; |
1524 |
|
end; |
1525 |
|
TACommitRetaining: |
1610 |
|
end; |
1611 |
|
end; |
1612 |
|
|
1613 |
+ |
function TIBTransaction.GetEndAction: TTransactionAction; |
1614 |
+ |
begin |
1615 |
+ |
if FInEndTransaction then |
1616 |
+ |
Result := FEndAction |
1617 |
+ |
else |
1618 |
+ |
IBError(ibxeIB60feature, [nil]) |
1619 |
+ |
end; |
1620 |
+ |
|
1621 |
|
|
1622 |
|
function TIBTransaction.GetIdleTimer: Integer; |
1623 |
|
begin |