TDASQLErrorLog

Overview

The TDASQLErrorLog class logs errors that occured during the execution of a command that is declared in the Commands section of the Schema.

The TDASQLErrorLog class is part of the TDAServerLog, which logs all changes on the server side.

You can use the TDASQLErrorLog as base for the descendant classes that will log specific errors that occured during the execution of a command.

For example, in the code below, the TDASQLErrorLog class is used to register an exception that occured while executing the Logout command on the server side:

procedure DoLogout(const Session:TROSession; Connection:IDAConnection; ServerLog:TDAServerLog);
var 
  Cmd : IDASQLCommand;
  CommandLog:TDASQLCommandLog;
  ErrorLog:TDASQLErrorLog;
begin
  if (LogoutCommand<>`)
    then Cmd := ServiceSchema.NewCommand(Connection, 'Logout', ['SessionID'], 
                                         [GUIDToString(Session.SessionID)]);

  if Not Connection.InTransaction then
    Connection.BeginTransaction;
  try
    Cmd.Execute;
    Connection.CommitTransaction;

    CommandLog:=TDASQLCommandLog.Create(ServerLog, Session, Cmd, Cmd.SQL, 0);
  except
    on E:Exception do
    begin
      Connection.RollbackTransaction;

      ErrorLog:=TDASQLErrorLog.Create(ServerLog, Session, E, Cmd, Cmd.SQL);
    end;
  end;
end;

Location


 

constructor Create  reintroduce overload virtual    (declared in TROComplexType)

Creates a new instance.

constructor Create

constructor Create (TCollection)  overload override    (declared in TROComplexType)

Creates a new instance with given parameter.

constructor Create(aCollection: TCollection)

Parameters:

  • aCollection: collection

constructor Create (TDAServerLog, TROSession)  reintroduce    (declared in TDALogItem)

Creates a new instance with given parameters.

constructor Create(aServerLog: TDAServerLog; aSession: TROSession)

Parameters:

  • aServerLog: References to the TDAServerLog object that stores this log item.
  • aSession: References to the session object.

constructor Create (TDAServerLog, TROSession, Exception, IDASQLCommand, string)

Creates a new TDASQLErrorLog object with a specified server log aServerLog, an individual user session aSession, an error message aError, an executed command aCommand and a specified SQL statement aActualSQLText, all of which are associated with the executed command.

constructor Create(aServerLog: TDAServerLog; aSession: TROSession; aError: Exception; const aCommand: IDASQLCommand; aActualSQLText: string)

Parameters:

  • aServerLog: Specified server log that logs all changes on the server side.
  • aSession: Individual user session within the Session Management system of the Remoting SDK.
  • aError: Error message representing an error that occured during the execution of the command aCommand
  • aCommand: Specified command that is represented in the Commands section of the Schema.
  • aActualSQLText: Specified SQL statement that is associated with the current command.

constructor Create (TDAServerLog, TROSession, IDASQLCommand, string, Cardinal)    (declared in TDASQLCommandLog)

Creates a new TDASQLCommandLog object. The aServerLog represents the specified server log that logs all the changes on the server side. The aSession represents an individual user session within the Session Management system of Remoting SDK. The aCommand represents the specified command that is represented in the Commands section of the Schema. The aActualSQLText represents the specified SQL statement that is associated with the current logging command. The aElapsedMilliseconds represents the time taken to execute the command in milliseconds.

constructor Create(aServerLog: TDAServerLog; aSession: TROSession; const aCommand: IDASQLCommand; aActualSQLText: string; aElapsedMilliseconds: Cardinal)

Parameters:

  • aServerLog: Specified server log that logs all the changes on the server side.
  • aSession: Individual user session within the Session Management system of Remoting SDK.
  • aCommand: Specified command that is represented in the Commands section of the Schema.
  • aActualSQLText: Specified SQL statement that is associated with the current command.
  • aElapsedMilliseconds: Time taken to execute the command in milliseconds.

ActualSQLText    (declared in TDASQLCommandLog)

Represents a specific SQL statement that is associated with the logging command.

property ActualSQLText: string read

Assign  override    (declared in TROComplexType)

Copies data from a given source.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AssignSession  protected virtual    (declared in TDALogItem)

Reads the SessionID property from the provided session object. If aSession is nil, the empty GUID will be assigned to the SessionID.

procedure AssignSession(aSession: TROSession)

Parameters:

  • aSession: Specified session.

AssignTo  override    (declared in TROComplexType)

Copies the properties of an object to a destination object.

procedure AssignTo(iDest: TPersistent)

Parameters:

  • iDest: destination object.

Clone    (declared in TROComplexType)

Creates and returns a second copy of the struct.

The new instance will be a deep copy of the original struct, all nested members that are arrays, structs or binaries will be duplicated as part of the cloning process, so that the new instance and its members will be completely independent from the original class.

function Clone: TROComplexType

ContentAsJson    (declared in TROComplexType)

property ContentAsJson: UnicodeString read

ContentAsString    (declared in TROComplexType)

Returns the structure of the type in a string format.

property ContentAsString: string read

ContentAsXml    (declared in TROComplexType)

Returns the XML structure of the type in a string format.

property ContentAsXml: ROUTF8String read

CreationTime    (declared in TDALogItem)

Holds the time of the log item creation. This property is automatically set at object creation.

property CreationTime: TDateTime read

ElapsedMilliseconds    (declared in TDASQLCommandLog)

Represents the time taken to execute the command in milliseconds.

property ElapsedMilliseconds: Cardinal read

ErrorMessage

Represents the error message that is associated with execution of the current command.

property ErrorMessage: string read

FieldCount    (declared in TROComplexType)

property FieldCount: Integer read

FieldInfo    (declared in TROComplexType)

property FieldInfo[Index: Integer]: PTypeInfo read

FieldName    (declared in TROComplexType)

property FieldName[Index: Integer]: string read

FreeInternalProperties  protected virtual    (declared in TROComplexType)

procedure FreeInternalProperties

GetAttributeCount  virtual    (declared in TROComplexType)

Returns the number of custom attributes defined for the class.

class function GetAttributeCount: Integer

GetAttributeName  virtual    (declared in TROComplexType)

Returns the name of custom attribute defined for the class, with the specified index.

class function GetAttributeName(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetAttributeValue  virtual    (declared in TROComplexType)

Returns the value of custom attribute defined for the class, with the specified index.

class function GetAttributeValue(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetContentAsJson    (declared in TROComplexType)

function GetContentAsJson(aIncludeExtraInfo: Boolean): UnicodeString

Parameters:

  • aIncludeExtraInfo:

GetContentAsXml    (declared in TROComplexType)

function GetContentAsXml(aOffset: Integer): ROUTF8String

Parameters:

  • aOffset:

GetFieldNames    (declared in TROComplexType)

procedure GetFieldNames(aList: TStrings)

Parameters:

  • aList:

GetFieldValue    (declared in TROComplexType)

function GetFieldValue(const aFieldName: string): Variant

Parameters:

  • aFieldName:

OriginalSQLText    (declared in TDASQLCommandLog)

Represents the original SQL statement that is declared in the Schema and associated with the logging command.

property OriginalSQLText: string read

Params    (declared in TDASQLCommandLog)

Represents the collection of parameters that are declared in the Parameters section of the Schema and associated with the logging command.

property Params: TDAParamCollection read

ReadComplex  virtual    (declared in TROComplexType)

Deserializes current class instance using provided serializer.

procedure ReadComplex(ASerializer: TObject)

Parameters:


SaveToJson  protected virtual    (declared in TROComplexType)

procedure SaveToJson(const aRoot: TROJSONValue; aIncludeExtraInfo: Boolean)

Parameters:

  • aRoot:
  • aIncludeExtraInfo:

SaveToXml  protected virtual    (declared in TROComplexType)

procedure SaveToXml(const aNode: TROConverterNode)

Parameters:

  • aNode:

ServerLog    (declared in TDALogItem)

References to the TDAServerLog object that stores this log item.

property ServerLog: TDAServerLog read

SessionID    (declared in TDALogItem)

Holds the unique session GUID.

property SessionID: TGUID read

SessionIDAsString    (declared in TDALogItem)

Returns a string representation of the session GUID.

property SessionIDAsString: string read

SetFieldValue    (declared in TROComplexType)

procedure SetFieldValue(const aFieldName: string; const aValue: Variant)

Parameters:

  • aFieldName:
  • aValue:

SmartAssign    (declared in TROComplexType)

Copies specific data from a given source.

procedure SmartAssign(Source: TPersistent; TypeKinds: TTypeKinds)

Parameters:

  • Source: Instance whose properties will be copied
  • TypeKinds: Specifies which properties should be copied

TryGetAttribute    (declared in TROComplexType)

class function TryGetAttribute(aName: string; out aValue: string): Boolean

Parameters:

  • aName:
  • aValue:

WriteComplex  virtual    (declared in TROComplexType)

Serializes current class instance using provided serializer.

procedure WriteComplex(ASerializer: TObject)

Parameters:

 

ActualSQLText    (declared in TDASQLCommandLog)

Represents a specific SQL statement that is associated with the logging command.

property ActualSQLText: string read

ContentAsJson    (declared in TROComplexType)

property ContentAsJson: UnicodeString read

ContentAsString    (declared in TROComplexType)

Returns the structure of the type in a string format.

property ContentAsString: string read

ContentAsXml    (declared in TROComplexType)

Returns the XML structure of the type in a string format.

property ContentAsXml: ROUTF8String read

CreationTime    (declared in TDALogItem)

Holds the time of the log item creation. This property is automatically set at object creation.

property CreationTime: TDateTime read

ElapsedMilliseconds    (declared in TDASQLCommandLog)

Represents the time taken to execute the command in milliseconds.

property ElapsedMilliseconds: Cardinal read

ErrorMessage

Represents the error message that is associated with execution of the current command.

property ErrorMessage: string read

FieldCount    (declared in TROComplexType)

property FieldCount: Integer read

FieldInfo    (declared in TROComplexType)

property FieldInfo[Index: Integer]: PTypeInfo read

FieldName    (declared in TROComplexType)

property FieldName[Index: Integer]: string read

OriginalSQLText    (declared in TDASQLCommandLog)

Represents the original SQL statement that is declared in the Schema and associated with the logging command.

property OriginalSQLText: string read

Params    (declared in TDASQLCommandLog)

Represents the collection of parameters that are declared in the Parameters section of the Schema and associated with the logging command.

property Params: TDAParamCollection read

ServerLog    (declared in TDALogItem)

References to the TDAServerLog object that stores this log item.

property ServerLog: TDAServerLog read

SessionID    (declared in TDALogItem)

Holds the unique session GUID.

property SessionID: TGUID read

SessionIDAsString    (declared in TDALogItem)

Returns a string representation of the session GUID.

property SessionIDAsString: string read

 

GetAttributeCount  virtual    (declared in TROComplexType)

Returns the number of custom attributes defined for the class.

class function GetAttributeCount: Integer

GetAttributeName  virtual    (declared in TROComplexType)

Returns the name of custom attribute defined for the class, with the specified index.

class function GetAttributeName(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetAttributeValue  virtual    (declared in TROComplexType)

Returns the value of custom attribute defined for the class, with the specified index.

class function GetAttributeValue(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

TryGetAttribute    (declared in TROComplexType)

class function TryGetAttribute(aName: string; out aValue: string): Boolean

Parameters:

  • aName:
  • aValue:

 

constructor Create  reintroduce overload virtual    (declared in TROComplexType)

Creates a new instance.

constructor Create

constructor Create (TCollection)  overload override    (declared in TROComplexType)

Creates a new instance with given parameter.

constructor Create(aCollection: TCollection)

Parameters:

  • aCollection: collection

constructor Create (TDAServerLog, TROSession)  reintroduce    (declared in TDALogItem)

Creates a new instance with given parameters.

constructor Create(aServerLog: TDAServerLog; aSession: TROSession)

Parameters:

  • aServerLog: References to the TDAServerLog object that stores this log item.
  • aSession: References to the session object.

constructor Create (TDAServerLog, TROSession, Exception, IDASQLCommand, string)

Creates a new TDASQLErrorLog object with a specified server log aServerLog, an individual user session aSession, an error message aError, an executed command aCommand and a specified SQL statement aActualSQLText, all of which are associated with the executed command.

constructor Create(aServerLog: TDAServerLog; aSession: TROSession; aError: Exception; const aCommand: IDASQLCommand; aActualSQLText: string)

Parameters:

  • aServerLog: Specified server log that logs all changes on the server side.
  • aSession: Individual user session within the Session Management system of the Remoting SDK.
  • aError: Error message representing an error that occured during the execution of the command aCommand
  • aCommand: Specified command that is represented in the Commands section of the Schema.
  • aActualSQLText: Specified SQL statement that is associated with the current command.

constructor Create (TDAServerLog, TROSession, IDASQLCommand, string, Cardinal)    (declared in TDASQLCommandLog)

Creates a new TDASQLCommandLog object. The aServerLog represents the specified server log that logs all the changes on the server side. The aSession represents an individual user session within the Session Management system of Remoting SDK. The aCommand represents the specified command that is represented in the Commands section of the Schema. The aActualSQLText represents the specified SQL statement that is associated with the current logging command. The aElapsedMilliseconds represents the time taken to execute the command in milliseconds.

constructor Create(aServerLog: TDAServerLog; aSession: TROSession; const aCommand: IDASQLCommand; aActualSQLText: string; aElapsedMilliseconds: Cardinal)

Parameters:

  • aServerLog: Specified server log that logs all the changes on the server side.
  • aSession: Individual user session within the Session Management system of Remoting SDK.
  • aCommand: Specified command that is represented in the Commands section of the Schema.
  • aActualSQLText: Specified SQL statement that is associated with the current command.
  • aElapsedMilliseconds: Time taken to execute the command in milliseconds.

Assign  override    (declared in TROComplexType)

Copies data from a given source.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AssignSession  protected virtual    (declared in TDALogItem)

Reads the SessionID property from the provided session object. If aSession is nil, the empty GUID will be assigned to the SessionID.

procedure AssignSession(aSession: TROSession)

Parameters:

  • aSession: Specified session.

AssignTo  override    (declared in TROComplexType)

Copies the properties of an object to a destination object.

procedure AssignTo(iDest: TPersistent)

Parameters:

  • iDest: destination object.

Clone    (declared in TROComplexType)

Creates and returns a second copy of the struct.

The new instance will be a deep copy of the original struct, all nested members that are arrays, structs or binaries will be duplicated as part of the cloning process, so that the new instance and its members will be completely independent from the original class.

function Clone: TROComplexType

FreeInternalProperties  protected virtual    (declared in TROComplexType)

procedure FreeInternalProperties

GetContentAsJson    (declared in TROComplexType)

function GetContentAsJson(aIncludeExtraInfo: Boolean): UnicodeString

Parameters:

  • aIncludeExtraInfo:

GetContentAsXml    (declared in TROComplexType)

function GetContentAsXml(aOffset: Integer): ROUTF8String

Parameters:

  • aOffset:

GetFieldNames    (declared in TROComplexType)

procedure GetFieldNames(aList: TStrings)

Parameters:

  • aList:

GetFieldValue    (declared in TROComplexType)

function GetFieldValue(const aFieldName: string): Variant

Parameters:

  • aFieldName:

ReadComplex  virtual    (declared in TROComplexType)

Deserializes current class instance using provided serializer.

procedure ReadComplex(ASerializer: TObject)

Parameters:


SaveToJson  protected virtual    (declared in TROComplexType)

procedure SaveToJson(const aRoot: TROJSONValue; aIncludeExtraInfo: Boolean)

Parameters:

  • aRoot:
  • aIncludeExtraInfo:

SaveToXml  protected virtual    (declared in TROComplexType)

procedure SaveToXml(const aNode: TROConverterNode)

Parameters:

  • aNode:

SetFieldValue    (declared in TROComplexType)

procedure SetFieldValue(const aFieldName: string; const aValue: Variant)

Parameters:

  • aFieldName:
  • aValue:

SmartAssign    (declared in TROComplexType)

Copies specific data from a given source.

procedure SmartAssign(Source: TPersistent; TypeKinds: TTypeKinds)

Parameters:

  • Source: Instance whose properties will be copied
  • TypeKinds: Specifies which properties should be copied

WriteComplex  virtual    (declared in TROComplexType)

Serializes current class instance using provided serializer.

procedure WriteComplex(ASerializer: TObject)

Parameters: