mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-16 06:06:13 +02:00
+ use InternalHandleException for exceptions when loading instances of TDataset, TDatabase or TDBTransaction
git-svn-id: trunk@1569 -
This commit is contained in:
parent
68dca23994
commit
ce1bb25e54
@ -32,12 +32,28 @@ begin
|
||||
DatabaseError(SConnected,Self);
|
||||
end;
|
||||
|
||||
Procedure TDatabase.InternalHandleException;
|
||||
|
||||
begin
|
||||
if assigned(classes.ApplicationHandleException) then
|
||||
classes.ApplicationHandleException(self)
|
||||
else
|
||||
ShowException(ExceptObject,ExceptAddr);
|
||||
end;
|
||||
|
||||
procedure TDataBase.Loaded;
|
||||
|
||||
begin
|
||||
inherited;
|
||||
if FOpenAfterRead then
|
||||
SetConnected(true);
|
||||
try
|
||||
if FOpenAfterRead then
|
||||
SetConnected(true);
|
||||
except
|
||||
if csDesigning in Componentstate then
|
||||
InternalHandleException
|
||||
else
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDataBase.SetConnected (Value : boolean);
|
||||
@ -310,9 +326,24 @@ procedure TDBTransaction.Loaded;
|
||||
|
||||
begin
|
||||
inherited;
|
||||
if FOpenAfterRead then SetActive(true);
|
||||
try
|
||||
if FOpenAfterRead then SetActive(true);
|
||||
except
|
||||
if csDesigning in Componentstate then
|
||||
InternalHandleException
|
||||
else
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
Procedure TDBTransaction.InternalHandleException;
|
||||
|
||||
begin
|
||||
if assigned(classes.ApplicationHandleException) then
|
||||
classes.ApplicationHandleException(self)
|
||||
else
|
||||
ShowException(ExceptObject,ExceptAddr);
|
||||
end;
|
||||
|
||||
Procedure TDBTransaction.CheckActive;
|
||||
|
||||
|
@ -702,6 +702,15 @@ begin
|
||||
result := FState <> dsInactive;
|
||||
end;
|
||||
|
||||
Procedure TDataset.InternalHandleException;
|
||||
|
||||
begin
|
||||
if assigned(classes.ApplicationHandleException) then
|
||||
classes.ApplicationHandleException(self)
|
||||
else
|
||||
ShowException(ExceptObject,ExceptAddr);
|
||||
end;
|
||||
|
||||
Procedure TDataset.SetActive (Value : Boolean);
|
||||
|
||||
begin
|
||||
@ -723,7 +732,14 @@ procedure TDataset.Loaded;
|
||||
|
||||
begin
|
||||
inherited;
|
||||
if FOpenAfterRead then SetActive(true);
|
||||
try
|
||||
if FOpenAfterRead then SetActive(true);
|
||||
except
|
||||
if csDesigning in Componentstate then
|
||||
InternalHandleException
|
||||
else
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -1072,7 +1072,7 @@ type
|
||||
procedure InternalDelete; virtual; abstract;
|
||||
procedure InternalFirst; virtual; abstract;
|
||||
procedure InternalGotoBookmark(ABookmark: Pointer); virtual; abstract;
|
||||
procedure InternalHandleException; virtual; abstract;
|
||||
procedure InternalHandleException; virtual;
|
||||
procedure InternalInitFieldDefs; virtual; abstract;
|
||||
procedure InternalInitRecord(Buffer: PChar); virtual; abstract;
|
||||
procedure InternalLast; virtual; abstract;
|
||||
@ -1355,6 +1355,7 @@ type
|
||||
Procedure CheckInactive;
|
||||
procedure EndTransaction; virtual; abstract;
|
||||
procedure StartTransaction; virtual; abstract;
|
||||
procedure InternalHandleException; virtual;
|
||||
procedure Loaded; override;
|
||||
Public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
@ -1398,6 +1399,7 @@ type
|
||||
protected
|
||||
Procedure CheckConnected;
|
||||
Procedure CheckDisConnected;
|
||||
procedure InternalHandleException; virtual;
|
||||
procedure Loaded; override;
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
Procedure DoInternalConnect; Virtual;Abstract;
|
||||
|
@ -65,7 +65,6 @@ type
|
||||
procedure InternalPost; override;
|
||||
// Misc methods:
|
||||
procedure InternalClose; override;
|
||||
procedure InternalHandleException; override;
|
||||
procedure InternalInitFieldDefs; override;
|
||||
procedure InternalOpen; override;
|
||||
function IsCursorOpen: Boolean; override;
|
||||
@ -348,12 +347,6 @@ begin
|
||||
FillChar(FDataFile, SizeOf(FDataFile), 0);
|
||||
end;
|
||||
|
||||
procedure TDDGDataSet.InternalHandleException;
|
||||
begin
|
||||
// standard implementation for this method:
|
||||
// Application.HandleException(Self);
|
||||
end;
|
||||
|
||||
procedure TDDGDataSet.InternalDelete;
|
||||
begin
|
||||
FIndexList.Delete(FRecordPos);
|
||||
|
@ -260,7 +260,6 @@ type
|
||||
procedure InternalDelete; override;
|
||||
procedure InternalFirst; override;
|
||||
procedure InternalGotoBookmark(ABookmark: Pointer); override;
|
||||
procedure InternalHandleException; override;
|
||||
procedure InternalInitFieldDefs; override;
|
||||
procedure InternalInitRecord(Buffer: PChar); override;
|
||||
procedure InternalLast; override;
|
||||
@ -1133,10 +1132,6 @@ begin
|
||||
FCurrentRecord := PInteger(ABookmark)^;
|
||||
end;
|
||||
|
||||
procedure TIBQuery.InternalHandleException;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TIBQuery.InternalInitFieldDefs;
|
||||
var
|
||||
x : integer;
|
||||
|
@ -81,7 +81,6 @@ type
|
||||
procedure InternalDelete; override;
|
||||
procedure InternalFirst; override;
|
||||
procedure InternalGotoBookmark(ABookmark: Pointer); override;
|
||||
procedure InternalHandleException; override;
|
||||
procedure InternalInitFieldDefs; override;
|
||||
procedure InternalInitRecord(Buffer: PChar); override;
|
||||
procedure InternalLast; override;
|
||||
@ -775,11 +774,6 @@ begin
|
||||
Result:=FStream.Size;
|
||||
end;
|
||||
|
||||
procedure TMemDataset.InternalHandleException;
|
||||
begin
|
||||
// Application.HandleException(Self);
|
||||
end;
|
||||
|
||||
procedure TMemDataset.Clear;
|
||||
|
||||
begin
|
||||
|
@ -108,7 +108,6 @@ type
|
||||
procedure InternalPost; override;
|
||||
// Misc methods:
|
||||
procedure InternalClose; override;
|
||||
procedure InternalHandleException; override;
|
||||
procedure InternalInitFieldDefs; override;
|
||||
procedure InternalOpen; override;
|
||||
function IsCursorOpen: Boolean; override;
|
||||
@ -358,11 +357,6 @@ begin
|
||||
FCurrentRecord := PInteger(ABookmark)^;
|
||||
end;
|
||||
|
||||
procedure TMySQLDataset.InternalHandleException;
|
||||
begin
|
||||
// Application.HandleException(self);
|
||||
end;
|
||||
|
||||
procedure TMySQLDataset.InternalInitFieldDefs;
|
||||
|
||||
var
|
||||
|
@ -108,7 +108,6 @@ type
|
||||
procedure InternalPost; override;
|
||||
// Misc methods:
|
||||
procedure InternalClose; override;
|
||||
procedure InternalHandleException; override;
|
||||
procedure InternalInitFieldDefs; override;
|
||||
procedure InternalOpen; override;
|
||||
function IsCursorOpen: Boolean; override;
|
||||
@ -358,11 +357,6 @@ begin
|
||||
FCurrentRecord := PInteger(ABookmark)^;
|
||||
end;
|
||||
|
||||
procedure TMySQLDataset.InternalHandleException;
|
||||
begin
|
||||
// Application.HandleException(self);
|
||||
end;
|
||||
|
||||
procedure TMySQLDataset.InternalInitFieldDefs;
|
||||
|
||||
var
|
||||
|
@ -405,6 +405,8 @@ procedure TFixedFormatDataSet.InternalHandleException;
|
||||
begin
|
||||
{$ifndef fpc}
|
||||
Application.HandleException(Self);
|
||||
{$else}
|
||||
inherited;
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
|
@ -202,7 +202,6 @@ type
|
||||
Procedure SetTransaction(Value : TDBTransaction); override;
|
||||
procedure InternalAddRecord(Buffer: Pointer; AAppend: Boolean); override;
|
||||
procedure InternalClose; override;
|
||||
procedure InternalHandleException; override;
|
||||
procedure InternalInitFieldDefs; override;
|
||||
procedure InternalOpen; override;
|
||||
function GetCanModify: Boolean; override;
|
||||
@ -710,10 +709,6 @@ begin
|
||||
inherited internalclose;
|
||||
end;
|
||||
|
||||
procedure TSQLQuery.InternalHandleException;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TSQLQuery.InternalInitFieldDefs;
|
||||
begin
|
||||
if FLoadingFieldDefs then
|
||||
|
@ -130,7 +130,6 @@ type
|
||||
procedure InternalDelete; override;
|
||||
procedure InternalFirst; override;
|
||||
procedure InternalGotoBookmark(ABookmark: Pointer); override;
|
||||
procedure InternalHandleException; override;
|
||||
procedure InternalInitRecord(Buffer: PChar); override;
|
||||
procedure InternalLast; override;
|
||||
procedure InternalOpen; override;
|
||||
@ -616,11 +615,6 @@ begin
|
||||
FCurrentItem := PDataRecord(ABookmark^);
|
||||
end;
|
||||
|
||||
procedure TCustomSqliteDataset.InternalHandleException;
|
||||
begin
|
||||
//??
|
||||
end;
|
||||
|
||||
procedure TCustomSqliteDataset.InternalInitRecord(Buffer: PChar);
|
||||
var
|
||||
Counter:Integer;
|
||||
|
@ -158,7 +158,6 @@ end;
|
||||
procedure InternalAddRecord(Buffer : Pointer; DoAppend : boolean); override;
|
||||
procedure InternalDelete; override;
|
||||
procedure InternalFirst; override;
|
||||
procedure InternalHandleException; override;
|
||||
procedure InternalInitRecord(Buffer : pChar); override;
|
||||
procedure InternalLast;override;
|
||||
procedure InternalPost;override;
|
||||
@ -985,14 +984,6 @@ begin
|
||||
self.fCurrentRecord:=0;
|
||||
end;
|
||||
|
||||
procedure TSQLite.InternalHandleException;
|
||||
begin
|
||||
{
|
||||
if _DO_EXCEPTIONS=1 then
|
||||
Application.HandleException(Self)
|
||||
}
|
||||
end;
|
||||
|
||||
procedure TSQLite.InternalInitRecord(Buffer: pChar);
|
||||
begin
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user