ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/IBDatabase.pas
(Generate patch)

Comparing ibx/trunk/runtime/IBDatabase.pas (file contents):
Revision 19 by tony, Mon Jul 7 13:00:15 2014 UTC vs.
Revision 23 by tony, Fri Mar 13 10:26:52 2015 UTC

# Line 159 | Line 159 | type
159      FHiddenPassword: string;
160      FIBLoaded: Boolean;
161      FOnLogin: TIBDatabaseLoginEvent;
162 +    FSQLHourGlass: Boolean;
163      FTraceFlags: TTraceFlags;
164      FDBSQLDialect: Integer;
165      FSQLDialect: Integer;
# Line 262 | Line 263 | type
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;
# Line 279 | Line 281 | type
281  
282    TIBTransaction = class(TComponent)
283    private
284 +    FAfterTransactionEnd: TNotifyEvent;
285 +    FBeforeTransactionEnd: TNotifyEvent;
286      FIBLoaded: Boolean;
287      FCanTimeout         : Boolean;
288      FDatabases          : TList;
# Line 295 | Line 299 | type
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;
# Line 336 | Line 343 | type
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;
# Line 357 | Line 365 | type
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 }
# Line 440 | Line 452 | begin
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');
# Line 1384 | Line 1397 | begin
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
# Line 1460 | Line 1485 | begin
1485    CheckInTransaction;
1486    if FInEndTransaction then Exit;
1487    FInEndTransaction := true;
1488 +  FEndAction := Action;
1489    try
1490    case Action of
1491      TARollback, TACommit:
# Line 1468 | Line 1494 | begin
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
# Line 1492 | Line 1519 | begin
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:
# Line 1582 | Line 1610 | begin
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines