TDataAbstractService

Overview

TDataAbstractService is the base class for the new v4.0-style servers.

You will generally use it as the base for implementing your data services with Data Abstract, either by using the service provided by the New Project templates or by defining your own services descending from the TDataAbstractService in your server's RODL.

TDataAbstractService implements all the necessary logic for providing data access and publishing data to the clients, so your service will be ready after just dropping a few components (which will already be provided by the new project templates) and fine-tuning a couple of properties; no manual code is required.

A large number of events are provided, allowing you to hook into all aspects of the data access to provide additional logic, validation, logging or other processing.

Location


 

constructor Create  override

Standard component constructor

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner.

AcquireConnection    (declared in TBaseDataAbstractService)

Toggles whether the service can automatically acquire a connection when needed (true, default) or not (false).

property AcquireConnection: Boolean read write

AllowAllFieldsInDynamicWhere

By security reasons, only fields that are present in table definition can be used in Dynamic Where expression.

This property allows to override default behavior and use any fields in such expressions. (Default value is False).

property AllowAllFieldsInDynamicWhere: Boolean read write

AllowCustomSqlMacros

Allows clients to use custom variables of Macro Processor.

property AllowCustomSqlMacros: Boolean read write

AllowDataAccess

Allows the clients to access schema information from the published schema (true, default) or not (false). Set this property to false if you want to prevent clients from accessing the data published by the ServiceSchema. This might be done on a per-client basis, depending on user rights, by setting the property on the OnActivate event.

property AllowDataAccess: Boolean read write

AllowDynamicOrder

Allows clients to use Dynamic Order feature.

property AllowDynamicOrder: Boolean read write

AllowDynamicSelect

Allows clients to use Dynamic Select feature.

property AllowDynamicSelect: Boolean read write

AllowDynamicWhere

Allows clients to use Dynamic Where feature.

property AllowDynamicWhere: Boolean read write

AllowExecuteCommands

Allows clients to execute commands that are published in the schema (true) or not (false, default). Set this property to true if you want to enable clients to manually execute commands defined in the ServiceSchema.

property AllowExecuteCommands: Boolean read write

AllowExecuteDASQL

Allows clients to use DA SQL feature.

property AllowExecuteDASQL: Boolean read write

AllowExecuteSQL

Allows clients to execute custom SQL, as command or for retrieving data published in the schema (true) or not (false, default). Since enabling this option opens a huge security risk, AllowExecuteSQL is set to false by default. If enabled, client applications can send custom SQL text to the server for execution, including code that could potentially harm or destroy the database. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.

property AllowExecuteSQL: Boolean read write

AllowRemoteEventsRegistration  protected    (declared in TRORemoteDataModule)

Obsolete, replaced by the LegacyEvents property.

function AllowRemoteEventsRegistration: Boolean

AllowSchemaAccess

Allows clients to access data from the published schema (true, default) or not (false). While access to schema information from the server is often helpful while designing the client application, most clients do not need to refresh schema information from the server at runtime. Although proper use of user authentication will restrict access, disabling this option for production servers prevents unnecessary exposure of the server's schema.

property AllowSchemaAccess: Boolean read write

AllowUpdates

Allows clients to update data.

property AllowUpdates: Boolean read write

AllowWhereSQL

Allows clients to transmit custom WHERE clauses as part of fetching data (true) or not (false, default). Since WHERE clauses are plain text base SQL, enabling this option opens a huge security risk, as malicious clients could use SQL injections to perform unexpected database operations as part of the submitted WHERE clause. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.

property AllowWhereSQL: Boolean read write

Assign  override

Copies data from a given source.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AutoCreateBusinessProcessors

Specifies if the service will automatically instantiate TDABusinessProcessors to process Deltas, if needed. If set to true (default), the service will use the TDABusinessProcessors dropped on the service to perform updates, if present, but will automatically create new Business Processors if none are configured for a particular data table. If set to false, the server will only process Deltas for tables that explicitly have a business processor configured for them; if none is configured, the Delta will be rejected with an exception.

property AutoCreateBusinessProcessors: Boolean read write

Check  protected

Validates TDataAbstractService properties.

procedure Check(CheckOnlyDataStreamer: Boolean)

Parameters:


CheckForConnectionManager    (declared in TBaseDataAbstractService)

Validates ServiceSchema.ConnectionManager property.

procedure CheckForConnectionManager

ClientID    (declared in TRORemoteDataModule)

The unique identifier for the client connected to the service. It is equal to the session ID if the session already exists. When the service method is called, this property is already initialized with a proper value. Do not change it unless you know what you are doing!

property ClientID: TGUID read write

Connection    (declared in TBaseDataAbstractService)

Returns a live connection to the back-end database based on the configured ConnectionName value. If a connection was previously requested, the same instance will be returned, if a fresh connection to the database couldn't be obtained from the connection manager. Once a connection is acquired, it will be held on until the service gets deactivated, or ReleaseConnection is called.

property Connection: IDAConnection read write

ConnectionName    (declared in TBaseDataAbstractService)

Defines the name of the connection that this service will use to connect to the back-end database. If set, all data access done by the service will use the specified connection; if not set, the default connection as defined in connection manager will be used. A typical use case for this property would be to set the connection name in the OnActivate or BeforeAcquireConnection event to match a specific connection, which, for example, could have been stored in the Sessions. The default code provided by the MultiDb Server template uses this approach. When setting ConnectionName and a connection is already acquired, make sure to call the ReleaseConnection method, so that a new connection will be obtained when needed.

property ConnectionName: string read write

CreateSession    (declared in TRORemoteDataModule)

Creates a new session object and makes it available via the Session property. As a rule, there is no need to call this method because the session is created automatically when required.

procedure CreateSession

CustomRequireSession  protected virtual    (declared in TRORemoteDataModule)

Internal use only, don't override.

function CustomRequireSession(const aMessage: IROMessage): Boolean

Parameters:

  • aMessage: Message

DASQLProcessor

DA SQL Processor

property DASQLProcessor: TDASQLProcessor read write

DestroySession    (declared in TRORemoteDataModule)

Destroys the current session object. This method is primarily used to destroy the session in case of unsuccessful client authentication.

procedure DestroySession

DoBeforeGetDatasetData  protected virtual

Fires BeforeGetDatasetData event.

procedure DoBeforeGetDatasetData(const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

Parameters:

  • aDataset: Source dataset.
  • aIncludeSchema: Schema information should be included or not.
  • aMaxRecords: The count of rows of the request.

DoBeforeGetTableData  protected

Used for assigning additional Dynamic Where expression in the OnBeforeGetTableData event

procedure DoBeforeGetTableData(const aDataset: IDADataset)

Parameters:

  • aDataset: Source dataset.

DoCommitTransaction  protected virtual

Commits transaction, fires OnUpdateDataCommitTransaction event and related Business Rules Scripting Events

procedure DoCommitTransaction(aConnection: IDAConnection)

Parameters:

  • aConnection: Used connection.

DoOnDeactivate  protected override

Destroys default connection.

procedure DoOnDeactivate(aClientID: TGUID)

Parameters:

  • aClientID: Client ID

DoRollbackTransaction  protected virtual

Rollbacks transaction, fires OnUpdateDataRollBackTransaction event and related Business Rules Scripting Events

procedure DoRollbackTransaction(aConnection: IDAConnection)

Parameters:

  • aConnection: Used connection.

DoStartTransaction  protected virtual

Starts transaction, fires OnUpdateDataBeginTransaction event and related Business Rules Scripting Events

function DoStartTransaction(var aConnection: IDAConnection): Boolean

Parameters:

  • aConnection: Used connection.

DoValidateCommandAccess  protected

Pefrorms processing of OnValidateCommandExecution

procedure DoValidateCommandAccess(const aConnection: IDAConnection; const aDatasetName: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aConnection: Used connection.
  • aDatasetName: Command name
  • aRec: internal structure that contain some shared data

DoValidateDataTableAccess  protected

Pefrorms processing of ValidateDatasetAccess

procedure DoValidateDataTableAccess(const aDatasetName: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aDatasetName: Dataset name
  • aRec: internal structure that contain some shared data

DoValidateDirectSQLAccess  protected

Pefrorms processing of OnValidateDirectSQLAccess

procedure DoValidateDirectSQLAccess(const aConnection: IDAConnection; const aSQLText: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aConnection: Used connection.
  • aSQLText: SQL text
  • aRec: internal structure that contain some shared data

EventRepository    (declared in TRORemoteDataModule)

Points to the event repository (TROEventRepository instance) for the service. The value must be set to use the events feature.

property EventRepository: TROEventRepository read write

ExecuteCommand  protected virtual

Executes specified command

function ExecuteCommand(const aCommandName: ROUTF8String; const aParameterArray: DataParameterArray): Integer

Parameters:

  • aCommandName: Command name in the Schema
  • aParameterArray: List of input paramaters

ExecuteCommandEx  protected virtual

Executes specified command

function ExecuteCommandEx(const aCommandName: ROUTF8String; const aInputParameters: DataParameterArray; out aOutputParameters: DataParameterArray): Integer

Parameters:

  • aCommandName: Command name in the Schema
  • aInputParameters: List of input paramaters
  • aOutputParameters: List of output paramaters

ExportedDataTables

Maintains a list of server-side TDADataTables that will be published by the server, alongside the data tables defined in the schema. This allows the service to publish data that does not necessarily come from the back-end database targeted by the schema and connection, but also from other sources. For example, the TDADataTables could be filled from a different database, loaded from a file on disk, or manually filled from code. For the client application, these tables will look like any other data table published by the server.

property ExportedDataTables: TDADataTableReferenceCollection read write

GetCommandSchema  protected virtual

Returns the definitions of the schema commands identified by the names passed through the parameter.

function GetCommandSchema(const aCommandNameArray: StringArray): ROUTF8String

Parameters:

  • aCommandNameArray: specifies the name or names of the commands

GetConnectionForObject  protected virtual

Returns connection for specified object

function GetConnectionForObject(const aName: string): IDAConnection

Parameters:

  • aName: name of object

GetData  protected virtual

Returns a stream that includes the data of all data tables indicated in the first parameter. Each data table can return a different number of rows or be opened using specific parameters that are passed as TableInfoRequest in the second parameter.

This method provides the primary means of fetching data from the server to the client, and is invoked when the Fill method is called on a client-side TDARemoteDataAdapter component.

function GetData(const aTableNameArray: StringArray; const aTableRequestInfoArray: TableRequestInfoArray): Binary

Parameters:

  • aTableNameArray: specifies the name or names of the tables to retrieve
  • aTableRequestInfoArray: specifies one or several TableRequestInfo with additional options

GetDatasetScripts  protected virtual

Returns client-side Business Rules scripts in xml format

function GetDatasetScripts(const DatasetNames: ROUTF8String): ROUTF8String

Parameters:

  • DatasetNames: List of dataset names which should be devided by comma

GetDispatchInfo  protected virtual    (declared in TRORemoteDataModule)

Allows to grab the input parameters to get all information about the upcoming call including the remote method parameters and the calling client transport object.

procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

Parameters:

  • aTransport: Points to the transport object containing connection-specific information
  • aMessage: Message that needs to be processed

GetEventsData  protected    (declared in TRORemoteDataModule)

Collects events data to the memory stream. For internal use only, don't call or override.

function GetEventsData(const ClientID: string; out EventsData: Binary): Integer

Parameters:

  • ClientID: Client ID
  • EventsData: Binary stream that holds the event data

GetSchema  protected virtual

Returns the schema referenced by the service to the calling client application, as XML.

function GetSchema(const aFilter: ROUTF8String): ROUTF8String

Parameters:

  • aFilter: not used

GetScriptContext  protected virtual

Returns Business Rules script content

function GetScriptContext: IDAServerScriptContext

GetServiceMetaData  protected

Returns associated schema in json format.

function GetServiceMetaData(aQueryString: string; out aContentType: string): TStream

Parameters:

  • aQueryString: Query string
  • aContentType: content type

GetTableSchema  protected virtual

Returns the definitions of the schema data tables identified by the names passed through the parameter.

function GetTableSchema(const aTableNameArray: StringArray): ROUTF8String

Parameters:

  • aTableNameArray: specifies the name or names of the tables

IsRetained  protected    (declared in TRORemoteDataModule)

Returns true if anObject is retained by Self.

function IsRetained(const anObject: TObject): Boolean

Parameters:

  • anObject: Object to check

IsSessionPresent    (declared in TRORemoteDataModule)

Checks if session is present

function IsSessionPresent: Boolean

LegacyEvents    (declared in TRORemoteDataModule)

Enables or disables the legacy events mode for the service. The default value is true. The legacy mode is less secure and it is recommended to set this property to false for new projects. Note that refusing to use the legacy mode will break compatibility with legacy Delphi clients.

property LegacyEvents: Boolean read write

NewSession    (declared in TRORemoteDataModule)

Indicates that the client's session was just created, i.e. this indicates the first connection of a so far unknown client.

property NewSession: Boolean read

OnAcquireConnectionFailure    (declared in TBaseDataAbstractService)

Fired when acquiring a connection failed.

property OnAcquireConnectionFailure: TDAAcquireConnectionFailureEvent read write
delegate: procedure OnAcquireConnectionFailure(aSender: TObject; const aConnectionName: string; aError: Exception)

OnActivate    (declared in TRORemoteDataModule)

Called just after the service is created and before any service method is called. Handle this event for everything you need to do when the service instance is created.

property OnActivate: TActivateEvent read write
delegate: procedure OnActivate(const aClientID: TGUID; aSession: TROSession; const aMessage: IROMessage)

OnAfterAcquireConnection    (declared in TBaseDataAbstractService)

Fires right after a new connection is acquired through the Connection property. Use this event to make perform initializations on the new connection, such as opening a transaction, or setting connection options.

property OnAfterAcquireConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnAfterAcquireConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnAfterExecuteCommand

Fires right after a command was executed.

property OnAfterExecuteCommand: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecuteCommand(aSender: TObject; const aCommand: IDASQLCommand; aRowsAffacted: Integer)

OnAfterGetDatasetData

Fires right after data for a dataset (data table) was retrieved.

property OnAfterGetDatasetData: TDAGetDatasetDataEvent read write
delegate: procedure OnAfterGetDatasetData(aSender: TObject; const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

OnAfterGetDatasetSchema

Fires right after schema info for a dataset (data table) was retrieved.

property OnAfterGetDatasetSchema: TDAGetDatasetSchemaEvent read write
delegate: procedure OnAfterGetDatasetSchema(aSender: TObject; const aDataset: IDADataset)

OnAfterProcessDeltas

Fires right after Deltas for a data table have been processed.

property OnAfterProcessDeltas: TDAProcessDeltasEvent read write
delegate: procedure OnAfterProcessDeltas(aSender: TObject; aDeltaStructs: TDADeltaStructList)

OnAfterReleaseConnection    (declared in TBaseDataAbstractService)

Fires right after a connection is released.

property OnAfterReleaseConnection: TDAConnectionReleasedEvent read write
delegate: procedure OnAfterReleaseConnection(aSender: TObject; const aConnectionName: string)

OnBeforeAcquireConnection    (declared in TBaseDataAbstractService)

Fires just before a new connection is acquired through the Connection property. Use this event to make last-minute configurations before the connection will be acquired, such as changing the ConnectionName.

property OnBeforeAcquireConnection: TDAAcquireConnectionEvent read write
delegate: procedure OnBeforeAcquireConnection(aSender: TObject; var aConnectionName: string)

OnBeforeExecuteCommand

Fires just before a command will be executed.

property OnBeforeExecuteCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteCommand(aSender: TObject; const aCommand: IDASQLCommand)

OnBeforeExecuteDeltaCommand

Fires just before a delta command will be executed.

property OnBeforeExecuteDeltaCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteDeltaCommand(const Sender: IDASQLCommand)

OnBeforeGetDatasetData

Fires just before data for a dataset (data table) is retrieved.

property OnBeforeGetDatasetData: TDAGetDatasetDataEvent read write
delegate: procedure OnBeforeGetDatasetData(aSender: TObject; const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

OnBeforeGetDatasetSchema

Fires just before schema info for a dataset (data table) is retrieved.

property OnBeforeGetDatasetSchema: TDAGetDatasetSchemaEvent read write
delegate: procedure OnBeforeGetDatasetSchema(aSender: TObject; const aDataset: IDADataset)

OnBeforeGetTableData

This event allows to provide additional Dynamic Where expression.

property OnBeforeGetTableData: TDABeforeGetTableData read write
delegate: procedure OnBeforeGetTableData(aSender: TObject; aTableName: string; var aAdditionalWhere: TDAWhereExpression)

OnBeforeProcessDeltas

Fires just before Deltas for a data table will be processed.

property OnBeforeProcessDeltas: TDAProcessDeltasEvent read write
delegate: procedure OnBeforeProcessDeltas(aSender: TObject; aDeltaStructs: TDADeltaStructList)

OnBeforeRegisterEventClient    (declared in TRORemoteDataModule)

Called when the new client is being registered to receive events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeRegisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeRegisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBeforeReleaseConnection    (declared in TBaseDataAbstractService)

Fires just before the connection is released. Use this event to perform any finalization tasks on the new connection, such as closing a transaction, or setting connection options.

property OnBeforeReleaseConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnBeforeReleaseConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnBeforeUnregisterEventClient    (declared in TRORemoteDataModule)

Called when the client is being unsubscribed from events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeUnregisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeUnregisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBusinessProcessorAutoCreated

Fires whenever a new TDABusinessProcessor was auto-created to process deltas. You can use this event to perform additional configuration on the Business Processor before it will be used.

property OnBusinessProcessorAutoCreated: TDABusinessProcessorAutoCreatedEvent read write
delegate: procedure OnBusinessProcessorAutoCreated(aSender: TRORemoteDataModule; BusinessProcessor: TDABusinessProcessor)

OnDeactivate    (declared in TRORemoteDataModule)

Called after the service method completes and before the service instance is freed. Handle this event to perform actions on service destruction, such as disposing of resources.

property OnDeactivate: TDeactivateEvent read write
delegate: procedure OnDeactivate(const aClientID: TGUID; aSession: TROSession)

OnGetDispatchInfo    (declared in TRORemoteDataModule)

This event is fired before the invoker executes the service method. Handle this event to preview remote methods about to be executed; the input parameters allow to get all information about the upcoming call including the remote method parameters and the calling client transport object.

property OnGetDispatchInfo: TGetDispatchInfoEvent read write
delegate: procedure OnGetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

OnGetSchemaAsXMLEvent

Fires whenever a client retrieves the ServiceSchema. You can use this event to manually adjust or filter the Schema XML before it will be returned to the client.

property OnGetSchemaAsXMLEvent: TDAGetSchemaAsXMLEvent read write
delegate: procedure OnGetSchemaAsXMLEvent(aSender: TObject; var aSchemaXML: ROUTF8String)

OnProcessDeltasError

Fires if an error occurred while processing Deltas. Among other things, you can use this event to determine whether processing of the remaining Delta changes should continue, or if all changes should be rejected.

property OnProcessDeltasError: TDAProcessDeltasErrorEvent read write
delegate: procedure OnProcessDeltasError(aSender: TObject; aDeltaStructs: TDADeltaStructList; aError: Exception; var aDoRaise: Boolean)

OnUnknownSqlMacroIdentifier    (declared in TBaseDataAbstractService)

Fires when unknown macro variable is found. it can be usable when user-defined variables are used inside sql or Dynamic Where expression.

property OnUnknownSqlMacroIdentifier: TOnUnknownIdentifier read write
delegate: function OnUnknownSqlMacroIdentifier(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnUpdateDataBeginTransaction

Fires when a transaction will be started for processing a new set of deltas. You can handle this event to determine if the transaction should be started (default) or not.

property OnUpdateDataBeginTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataBeginTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnUpdateDataCommitTransaction

Fires when a transaction used for processing Deltas will be committed. You can handle this event to determine if the transaction should be committed (default) or not.

property OnUpdateDataCommitTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataCommitTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnUpdateDataRollBackTransaction

Fires when a transaction used for processing Deltas will be rolled back due to errors. You can handle this event to determine if the transaction should be rolled back (default) or not.

property OnUpdateDataRollBackTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataRollBackTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnValidateCommandExecution

Fires before a command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.

property OnValidateCommandExecution: TDASchemaElementAccessValidationEvent read write
delegate: procedure OnValidateCommandExecution(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of Variant; aSchema: TDASchema; var Allowed: Boolean)

OnValidateDatasetAccess

Fires before a data access retrieves data tables. You can use this event handler to do validation, for example to check if the current user is allowed to access the data table(s) in question, and raise an exception if the data access should be aborted.

property OnValidateDatasetAccess: TDASchemaElementAccessValidationEvent read write
delegate: procedure OnValidateDatasetAccess(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of Variant; aSchema: TDASchema; var Allowed: Boolean)

OnValidateDirectSQLAccess

Fires before a SQL command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.

property OnValidateDirectSQLAccess: TDASQLValidationEvent read write
delegate: procedure OnValidateDirectSQLAccess(Sender: TObject; const aConnection: IDAConnection; const aSQLText: string; const aParamNames: array of string; const aParamValues: array of Variant; var Allowed: Boolean)

OnValidateRoles    (declared in TRORemoteDataModule)

Validates roles.

property OnValidateRoles: TValidateRolesEvent read write
delegate: procedure OnValidateRoles(aRoles: array of string; var aAllow: Boolean)

ProcessDeltasWithoutUpdateRules

Manages whether the service will process Deltas for which no update rules have been defined (true) or not (false). If set to true (default), the service will process all delta packets it receives. If set to false, it will only process those deltas for which an update rule has been defined. Please refer to the Update Rules help topic for more details on update rules.

property ProcessDeltasWithoutUpdateRules: Boolean read write

RefCount    (declared in TRORemoteDataModule)

Reference counter - this class is the interfaced object.

property RefCount: Integer read

RegisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession: Client session
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterForDataChangeNotification  protected virtual

Registers a new table which will be refreshed automatically after other users apply changes to it.

This method isn't implemented yet!

procedure RegisterForDataChangeNotification(const aTableName: ROUTF8String)

Parameters:

  • aTableName: table name

ReleaseConnection    (declared in TBaseDataAbstractService)

Releases any connection currently acquired in the Connection property.

procedure ReleaseConnection

ReleaseObject  protected    (declared in TRORemoteDataModule)

Takes away the hold of anObject set by RetainObject.

procedure ReleaseObject(const anObject: TObject)

Parameters:

  • anObject: Object to release

RequiresSession    (declared in TRORemoteDataModule)

This property should be set to true (perhaps with the designer) to make the service protected and to disallow unauthenticated clients to call its methods. Read more.

property RequiresSession: Boolean read write

RetainObject  protected    (declared in TRORemoteDataModule)

Sets the hold of anObject.

procedure RetainObject(const anObject: TObject)

Parameters:

  • anObject: Object to hold

ReturnFullSchema

Allows to return full schema including content of statements. by default is False. We recommend to not change this value by security reasons.

property ReturnFullSchema: Boolean read write

ReturnUpdateFailureDelta

Part of Reconcile Dialog feature. Allows to return of failed changes to client via setting RaiseExceptionAtError for all autogenerated TDABusinessProcessor. by default is True.

Can be used for applying changes for several tables in one transaction with False value.

See also TDABusinessProcessor.RaiseExceptionAtError

property ReturnUpdateFailureDelta: Boolean read write

ScriptProvider

Specifies Business Rules Scripting provider.

property ScriptProvider: IDAScriptProvider read write

ServeSchema

Allows to return service's schema by

property ServeSchema: Boolean read write

ServiceDataStreamer

References the TDADataStreamer that will be used to stream data to and from the network. The data streamer determines the format that will be used to send data on the wire, so the type selected on the service must match the type selected for the TDARemoteDataAdapter.DataStreamer property on the client. Note that data streamers are not re-entrant, so every service instance must use its own data streamer instance. The best way to achieve this is to make sure the data streamer component is dropped into the service module itself, and not referenced from elsewhere. Also note that the data streamer assigned to the ServiceDataStreamer should be reserved for use by the service only. If you do any custom processing requiring a data streamer in your own code (such as filling server-side TDADataTables), make sure to use a second streamer instance for this, to avoid conflicts.

property ServiceDataStreamer: TDADataStreamer read write

ServiceSchema    (declared in TBaseDataAbstractService)

This property points to the TDASchema component defining the schema that will be published by this service. This can be a schema component located on the service data module or (more typically) on a separate global data module in the server application. Data Abstract uses a 1:1 mapping of services and schemas, where every service publishes one schema. Depending on your application design and the scope of your server, you might only use one schema for the entire data access, or logically partition your data tables across different schemas (and services). Locating the schema on a global data module rather than the service module itself might provide a slight performance benefit, as the schema structure only has to be loaded into memory once (on application startup), not every time a new service instance is created. Also note that the TDAConnectionManager (referenced from the schema) must be located off the service module and in a global location for connection pooling to work properly across service instances.

property ServiceSchema: TDASchema read write

ServiceValidateRoles  protected    (declared in TRORemoteDataModule)

Validates roles.

procedure ServiceValidateRoles(aRequiredRoles: array of string)

Parameters:

  • aRequiredRoles: Roles

Session    (declared in TRORemoteDataModule)

Provides access to the session object of the current connection. If the session does not exist, it is created at the moment of property access.

property Session: TROSession read

SessionManager    (declared in TRORemoteDataModule)

Points to the session manager to use. It is necessary to assign the session manager if the protected service is being developed and/or it is necessary to use the events feature.

property SessionManager: TROCustomSessionManager read write

SimpleGetData  protected virtual

Simplified GetData method that is used in Odata calls

function SimpleGetData(const Request: SimpleRequestInfoArray): SimpleDataResultArray

Parameters:

  • Request: the requests to send to the server. These will all be processed in the same transaction.

SimpleUpdateData  protected virtual

Simplified UpdateData method that is used in Odata calls

function SimpleUpdateData(const aDelta: SimpleDeltaArray): SimpleDeltaArray

Parameters:

  • aDelta: delta list to process

SQLExecuteCommand  protected virtual

Executes the passed SQL statement as a command.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.

function SQLExecuteCommand(const aSQLText: ROUTF8String): Integer

Parameters:

  • aSQLText: SQL statement

SQLExecuteCommandEx  protected virtual

Executes the passed SQL statement and returns the record set as streamed data table. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLExecuteCommandEx(const aSQLText: ROUTF8String; const aDynamicWhere: UnicodeString): Integer

Parameters:

  • aSQLText: SQL statement
  • aDynamicWhere: xml with Dynamic Where condition

SQLGetData  protected virtual

Executes the passed SQL statement and returns the record set as streamed data table.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLGetData(const aSQLText: ROUTF8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer): Binary

Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.

SQLGetDataEx  protected virtual

Executes the passed SQL statement and returns the record set as streamed data table. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLGetDataEx(const aSQLText: ROUTF8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer; const aDynamicWhere: UnicodeString): Binary

Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.
  • aDynamicWhere: xml with Dynamic Where condition

Synchronize  protected    (declared in TRORemoteDataModule)

procedure Synchronize(aMethod: TThreadMethod)

Parameters:

  • aMethod:

Transport    (declared in TRORemoteDataModule)

Provides access to the transport object that processes the current network (or other) connection to the server. Various information, such as client IP address, can be available via the transport objects.

property Transport: IROTransport read

UnregisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession:
  • EventTypes:

UnregisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

The action is opposite to RegisterEventClient, it cancels the subscription. Unregistration is not absolutely necessary as the client session dies after some time of inactivity but allows to conserve some system resources.

procedure UnregisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to unsubscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to unsubscribe the client from.

UnregisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID:
  • EventTypes:

UnregisterForDataChangeNotification  protected virtual

Unregisters a table that was registered by the RegisterForDataChangeNotification method.

This method isn't implemented yet!

procedure UnregisterForDataChangeNotification(const aTableName: ROUTF8String)

Parameters:

  • aTableName: table name

UpdateData  protected virtual

Applies the deltas encoded in the passed stream to the database and returns a stream that includes status information about the applied updates and possibly refreshed data for the client.

This method provides the primary means of applying data updates from the client back to the server, and is invoked when the Update method is called on a client-side remote data adapter component.

function UpdateData(const aDelta: Binary): Binary

Parameters:

  • aDelta: delta list to process

 

AcquireConnection    (declared in TBaseDataAbstractService)

Toggles whether the service can automatically acquire a connection when needed (true, default) or not (false).

property AcquireConnection: Boolean read write

AllowAllFieldsInDynamicWhere

By security reasons, only fields that are present in table definition can be used in Dynamic Where expression.

This property allows to override default behavior and use any fields in such expressions. (Default value is False).

property AllowAllFieldsInDynamicWhere: Boolean read write

AllowCustomSqlMacros

Allows clients to use custom variables of Macro Processor.

property AllowCustomSqlMacros: Boolean read write

AllowDataAccess

Allows the clients to access schema information from the published schema (true, default) or not (false). Set this property to false if you want to prevent clients from accessing the data published by the ServiceSchema. This might be done on a per-client basis, depending on user rights, by setting the property on the OnActivate event.

property AllowDataAccess: Boolean read write

AllowDynamicOrder

Allows clients to use Dynamic Order feature.

property AllowDynamicOrder: Boolean read write

AllowDynamicSelect

Allows clients to use Dynamic Select feature.

property AllowDynamicSelect: Boolean read write

AllowDynamicWhere

Allows clients to use Dynamic Where feature.

property AllowDynamicWhere: Boolean read write

AllowExecuteCommands

Allows clients to execute commands that are published in the schema (true) or not (false, default). Set this property to true if you want to enable clients to manually execute commands defined in the ServiceSchema.

property AllowExecuteCommands: Boolean read write

AllowExecuteDASQL

Allows clients to use DA SQL feature.

property AllowExecuteDASQL: Boolean read write

AllowExecuteSQL

Allows clients to execute custom SQL, as command or for retrieving data published in the schema (true) or not (false, default). Since enabling this option opens a huge security risk, AllowExecuteSQL is set to false by default. If enabled, client applications can send custom SQL text to the server for execution, including code that could potentially harm or destroy the database. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.

property AllowExecuteSQL: Boolean read write

AllowSchemaAccess

Allows clients to access data from the published schema (true, default) or not (false). While access to schema information from the server is often helpful while designing the client application, most clients do not need to refresh schema information from the server at runtime. Although proper use of user authentication will restrict access, disabling this option for production servers prevents unnecessary exposure of the server's schema.

property AllowSchemaAccess: Boolean read write

AllowUpdates

Allows clients to update data.

property AllowUpdates: Boolean read write

AllowWhereSQL

Allows clients to transmit custom WHERE clauses as part of fetching data (true) or not (false, default). Since WHERE clauses are plain text base SQL, enabling this option opens a huge security risk, as malicious clients could use SQL injections to perform unexpected database operations as part of the submitted WHERE clause. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.

property AllowWhereSQL: Boolean read write

AutoCreateBusinessProcessors

Specifies if the service will automatically instantiate TDABusinessProcessors to process Deltas, if needed. If set to true (default), the service will use the TDABusinessProcessors dropped on the service to perform updates, if present, but will automatically create new Business Processors if none are configured for a particular data table. If set to false, the server will only process Deltas for tables that explicitly have a business processor configured for them; if none is configured, the Delta will be rejected with an exception.

property AutoCreateBusinessProcessors: Boolean read write

ClientID    (declared in TRORemoteDataModule)

The unique identifier for the client connected to the service. It is equal to the session ID if the session already exists. When the service method is called, this property is already initialized with a proper value. Do not change it unless you know what you are doing!

property ClientID: TGUID read write

Connection    (declared in TBaseDataAbstractService)

Returns a live connection to the back-end database based on the configured ConnectionName value. If a connection was previously requested, the same instance will be returned, if a fresh connection to the database couldn't be obtained from the connection manager. Once a connection is acquired, it will be held on until the service gets deactivated, or ReleaseConnection is called.

property Connection: IDAConnection read write

ConnectionName    (declared in TBaseDataAbstractService)

Defines the name of the connection that this service will use to connect to the back-end database. If set, all data access done by the service will use the specified connection; if not set, the default connection as defined in connection manager will be used. A typical use case for this property would be to set the connection name in the OnActivate or BeforeAcquireConnection event to match a specific connection, which, for example, could have been stored in the Sessions. The default code provided by the MultiDb Server template uses this approach. When setting ConnectionName and a connection is already acquired, make sure to call the ReleaseConnection method, so that a new connection will be obtained when needed.

property ConnectionName: string read write

DASQLProcessor

DA SQL Processor

property DASQLProcessor: TDASQLProcessor read write

EventRepository    (declared in TRORemoteDataModule)

Points to the event repository (TROEventRepository instance) for the service. The value must be set to use the events feature.

property EventRepository: TROEventRepository read write

ExportedDataTables

Maintains a list of server-side TDADataTables that will be published by the server, alongside the data tables defined in the schema. This allows the service to publish data that does not necessarily come from the back-end database targeted by the schema and connection, but also from other sources. For example, the TDADataTables could be filled from a different database, loaded from a file on disk, or manually filled from code. For the client application, these tables will look like any other data table published by the server.

property ExportedDataTables: TDADataTableReferenceCollection read write

LegacyEvents    (declared in TRORemoteDataModule)

Enables or disables the legacy events mode for the service. The default value is true. The legacy mode is less secure and it is recommended to set this property to false for new projects. Note that refusing to use the legacy mode will break compatibility with legacy Delphi clients.

property LegacyEvents: Boolean read write

NewSession    (declared in TRORemoteDataModule)

Indicates that the client's session was just created, i.e. this indicates the first connection of a so far unknown client.

property NewSession: Boolean read

ProcessDeltasWithoutUpdateRules

Manages whether the service will process Deltas for which no update rules have been defined (true) or not (false). If set to true (default), the service will process all delta packets it receives. If set to false, it will only process those deltas for which an update rule has been defined. Please refer to the Update Rules help topic for more details on update rules.

property ProcessDeltasWithoutUpdateRules: Boolean read write

RefCount    (declared in TRORemoteDataModule)

Reference counter - this class is the interfaced object.

property RefCount: Integer read

RequiresSession    (declared in TRORemoteDataModule)

This property should be set to true (perhaps with the designer) to make the service protected and to disallow unauthenticated clients to call its methods. Read more.

property RequiresSession: Boolean read write

ReturnFullSchema

Allows to return full schema including content of statements. by default is False. We recommend to not change this value by security reasons.

property ReturnFullSchema: Boolean read write

ReturnUpdateFailureDelta

Part of Reconcile Dialog feature. Allows to return of failed changes to client via setting RaiseExceptionAtError for all autogenerated TDABusinessProcessor. by default is True.

Can be used for applying changes for several tables in one transaction with False value.

See also TDABusinessProcessor.RaiseExceptionAtError

property ReturnUpdateFailureDelta: Boolean read write

ScriptProvider

Specifies Business Rules Scripting provider.

property ScriptProvider: IDAScriptProvider read write

ServeSchema

Allows to return service's schema by

property ServeSchema: Boolean read write

ServiceDataStreamer

References the TDADataStreamer that will be used to stream data to and from the network. The data streamer determines the format that will be used to send data on the wire, so the type selected on the service must match the type selected for the TDARemoteDataAdapter.DataStreamer property on the client. Note that data streamers are not re-entrant, so every service instance must use its own data streamer instance. The best way to achieve this is to make sure the data streamer component is dropped into the service module itself, and not referenced from elsewhere. Also note that the data streamer assigned to the ServiceDataStreamer should be reserved for use by the service only. If you do any custom processing requiring a data streamer in your own code (such as filling server-side TDADataTables), make sure to use a second streamer instance for this, to avoid conflicts.

property ServiceDataStreamer: TDADataStreamer read write

ServiceSchema    (declared in TBaseDataAbstractService)

This property points to the TDASchema component defining the schema that will be published by this service. This can be a schema component located on the service data module or (more typically) on a separate global data module in the server application. Data Abstract uses a 1:1 mapping of services and schemas, where every service publishes one schema. Depending on your application design and the scope of your server, you might only use one schema for the entire data access, or logically partition your data tables across different schemas (and services). Locating the schema on a global data module rather than the service module itself might provide a slight performance benefit, as the schema structure only has to be loaded into memory once (on application startup), not every time a new service instance is created. Also note that the TDAConnectionManager (referenced from the schema) must be located off the service module and in a global location for connection pooling to work properly across service instances.

property ServiceSchema: TDASchema read write

Session    (declared in TRORemoteDataModule)

Provides access to the session object of the current connection. If the session does not exist, it is created at the moment of property access.

property Session: TROSession read

SessionManager    (declared in TRORemoteDataModule)

Points to the session manager to use. It is necessary to assign the session manager if the protected service is being developed and/or it is necessary to use the events feature.

property SessionManager: TROCustomSessionManager read write

Transport    (declared in TRORemoteDataModule)

Provides access to the transport object that processes the current network (or other) connection to the server. Various information, such as client IP address, can be available via the transport objects.

property Transport: IROTransport read

 

constructor Create  override

Standard component constructor

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner.

AllowRemoteEventsRegistration  protected    (declared in TRORemoteDataModule)

Obsolete, replaced by the LegacyEvents property.

function AllowRemoteEventsRegistration: Boolean

Assign  override

Copies data from a given source.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

Check  protected

Validates TDataAbstractService properties.

procedure Check(CheckOnlyDataStreamer: Boolean)

Parameters:


CheckForConnectionManager    (declared in TBaseDataAbstractService)

Validates ServiceSchema.ConnectionManager property.

procedure CheckForConnectionManager

CreateSession    (declared in TRORemoteDataModule)

Creates a new session object and makes it available via the Session property. As a rule, there is no need to call this method because the session is created automatically when required.

procedure CreateSession

CustomRequireSession  protected virtual    (declared in TRORemoteDataModule)

Internal use only, don't override.

function CustomRequireSession(const aMessage: IROMessage): Boolean

Parameters:

  • aMessage: Message

DestroySession    (declared in TRORemoteDataModule)

Destroys the current session object. This method is primarily used to destroy the session in case of unsuccessful client authentication.

procedure DestroySession

DoBeforeGetDatasetData  protected virtual

Fires BeforeGetDatasetData event.

procedure DoBeforeGetDatasetData(const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

Parameters:

  • aDataset: Source dataset.
  • aIncludeSchema: Schema information should be included or not.
  • aMaxRecords: The count of rows of the request.

DoBeforeGetTableData  protected

Used for assigning additional Dynamic Where expression in the OnBeforeGetTableData event

procedure DoBeforeGetTableData(const aDataset: IDADataset)

Parameters:

  • aDataset: Source dataset.

DoCommitTransaction  protected virtual

Commits transaction, fires OnUpdateDataCommitTransaction event and related Business Rules Scripting Events

procedure DoCommitTransaction(aConnection: IDAConnection)

Parameters:

  • aConnection: Used connection.

DoOnDeactivate  protected override

Destroys default connection.

procedure DoOnDeactivate(aClientID: TGUID)

Parameters:

  • aClientID: Client ID

DoRollbackTransaction  protected virtual

Rollbacks transaction, fires OnUpdateDataRollBackTransaction event and related Business Rules Scripting Events

procedure DoRollbackTransaction(aConnection: IDAConnection)

Parameters:

  • aConnection: Used connection.

DoStartTransaction  protected virtual

Starts transaction, fires OnUpdateDataBeginTransaction event and related Business Rules Scripting Events

function DoStartTransaction(var aConnection: IDAConnection): Boolean

Parameters:

  • aConnection: Used connection.

DoValidateCommandAccess  protected

Pefrorms processing of OnValidateCommandExecution

procedure DoValidateCommandAccess(const aConnection: IDAConnection; const aDatasetName: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aConnection: Used connection.
  • aDatasetName: Command name
  • aRec: internal structure that contain some shared data

DoValidateDataTableAccess  protected

Pefrorms processing of ValidateDatasetAccess

procedure DoValidateDataTableAccess(const aDatasetName: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aDatasetName: Dataset name
  • aRec: internal structure that contain some shared data

DoValidateDirectSQLAccess  protected

Pefrorms processing of OnValidateDirectSQLAccess

procedure DoValidateDirectSQLAccess(const aConnection: IDAConnection; const aSQLText: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aConnection: Used connection.
  • aSQLText: SQL text
  • aRec: internal structure that contain some shared data

ExecuteCommand  protected virtual

Executes specified command

function ExecuteCommand(const aCommandName: ROUTF8String; const aParameterArray: DataParameterArray): Integer

Parameters:

  • aCommandName: Command name in the Schema
  • aParameterArray: List of input paramaters

ExecuteCommandEx  protected virtual

Executes specified command

function ExecuteCommandEx(const aCommandName: ROUTF8String; const aInputParameters: DataParameterArray; out aOutputParameters: DataParameterArray): Integer

Parameters:

  • aCommandName: Command name in the Schema
  • aInputParameters: List of input paramaters
  • aOutputParameters: List of output paramaters

GetCommandSchema  protected virtual

Returns the definitions of the schema commands identified by the names passed through the parameter.

function GetCommandSchema(const aCommandNameArray: StringArray): ROUTF8String

Parameters:

  • aCommandNameArray: specifies the name or names of the commands

GetConnectionForObject  protected virtual

Returns connection for specified object

function GetConnectionForObject(const aName: string): IDAConnection

Parameters:

  • aName: name of object

GetData  protected virtual

Returns a stream that includes the data of all data tables indicated in the first parameter. Each data table can return a different number of rows or be opened using specific parameters that are passed as TableInfoRequest in the second parameter.

This method provides the primary means of fetching data from the server to the client, and is invoked when the Fill method is called on a client-side TDARemoteDataAdapter component.

function GetData(const aTableNameArray: StringArray; const aTableRequestInfoArray: TableRequestInfoArray): Binary

Parameters:

  • aTableNameArray: specifies the name or names of the tables to retrieve
  • aTableRequestInfoArray: specifies one or several TableRequestInfo with additional options

GetDatasetScripts  protected virtual

Returns client-side Business Rules scripts in xml format

function GetDatasetScripts(const DatasetNames: ROUTF8String): ROUTF8String

Parameters:

  • DatasetNames: List of dataset names which should be devided by comma

GetDispatchInfo  protected virtual    (declared in TRORemoteDataModule)

Allows to grab the input parameters to get all information about the upcoming call including the remote method parameters and the calling client transport object.

procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

Parameters:

  • aTransport: Points to the transport object containing connection-specific information
  • aMessage: Message that needs to be processed

GetEventsData  protected    (declared in TRORemoteDataModule)

Collects events data to the memory stream. For internal use only, don't call or override.

function GetEventsData(const ClientID: string; out EventsData: Binary): Integer

Parameters:

  • ClientID: Client ID
  • EventsData: Binary stream that holds the event data

GetSchema  protected virtual

Returns the schema referenced by the service to the calling client application, as XML.

function GetSchema(const aFilter: ROUTF8String): ROUTF8String

Parameters:

  • aFilter: not used

GetScriptContext  protected virtual

Returns Business Rules script content

function GetScriptContext: IDAServerScriptContext

GetServiceMetaData  protected

Returns associated schema in json format.

function GetServiceMetaData(aQueryString: string; out aContentType: string): TStream

Parameters:

  • aQueryString: Query string
  • aContentType: content type

GetTableSchema  protected virtual

Returns the definitions of the schema data tables identified by the names passed through the parameter.

function GetTableSchema(const aTableNameArray: StringArray): ROUTF8String

Parameters:

  • aTableNameArray: specifies the name or names of the tables

IsRetained  protected    (declared in TRORemoteDataModule)

Returns true if anObject is retained by Self.

function IsRetained(const anObject: TObject): Boolean

Parameters:

  • anObject: Object to check

IsSessionPresent    (declared in TRORemoteDataModule)

Checks if session is present

function IsSessionPresent: Boolean

RegisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession: Client session
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterForDataChangeNotification  protected virtual

Registers a new table which will be refreshed automatically after other users apply changes to it.

This method isn't implemented yet!

procedure RegisterForDataChangeNotification(const aTableName: ROUTF8String)

Parameters:

  • aTableName: table name

ReleaseConnection    (declared in TBaseDataAbstractService)

Releases any connection currently acquired in the Connection property.

procedure ReleaseConnection

ReleaseObject  protected    (declared in TRORemoteDataModule)

Takes away the hold of anObject set by RetainObject.

procedure ReleaseObject(const anObject: TObject)

Parameters:

  • anObject: Object to release

RetainObject  protected    (declared in TRORemoteDataModule)

Sets the hold of anObject.

procedure RetainObject(const anObject: TObject)

Parameters:

  • anObject: Object to hold

ServiceValidateRoles  protected    (declared in TRORemoteDataModule)

Validates roles.

procedure ServiceValidateRoles(aRequiredRoles: array of string)

Parameters:

  • aRequiredRoles: Roles

SimpleGetData  protected virtual

Simplified GetData method that is used in Odata calls

function SimpleGetData(const Request: SimpleRequestInfoArray): SimpleDataResultArray

Parameters:

  • Request: the requests to send to the server. These will all be processed in the same transaction.

SimpleUpdateData  protected virtual

Simplified UpdateData method that is used in Odata calls

function SimpleUpdateData(const aDelta: SimpleDeltaArray): SimpleDeltaArray

Parameters:

  • aDelta: delta list to process

SQLExecuteCommand  protected virtual

Executes the passed SQL statement as a command.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.

function SQLExecuteCommand(const aSQLText: ROUTF8String): Integer

Parameters:

  • aSQLText: SQL statement

SQLExecuteCommandEx  protected virtual

Executes the passed SQL statement and returns the record set as streamed data table. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLExecuteCommandEx(const aSQLText: ROUTF8String; const aDynamicWhere: UnicodeString): Integer

Parameters:

  • aSQLText: SQL statement
  • aDynamicWhere: xml with Dynamic Where condition

SQLGetData  protected virtual

Executes the passed SQL statement and returns the record set as streamed data table.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLGetData(const aSQLText: ROUTF8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer): Binary

Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.

SQLGetDataEx  protected virtual

Executes the passed SQL statement and returns the record set as streamed data table. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLGetDataEx(const aSQLText: ROUTF8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer; const aDynamicWhere: UnicodeString): Binary

Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.
  • aDynamicWhere: xml with Dynamic Where condition

Synchronize  protected    (declared in TRORemoteDataModule)

procedure Synchronize(aMethod: TThreadMethod)

Parameters:

  • aMethod:

UnregisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession:
  • EventTypes:

UnregisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

The action is opposite to RegisterEventClient, it cancels the subscription. Unregistration is not absolutely necessary as the client session dies after some time of inactivity but allows to conserve some system resources.

procedure UnregisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to unsubscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to unsubscribe the client from.

UnregisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID:
  • EventTypes:

UnregisterForDataChangeNotification  protected virtual

Unregisters a table that was registered by the RegisterForDataChangeNotification method.

This method isn't implemented yet!

procedure UnregisterForDataChangeNotification(const aTableName: ROUTF8String)

Parameters:

  • aTableName: table name

UpdateData  protected virtual

Applies the deltas encoded in the passed stream to the database and returns a stream that includes status information about the applied updates and possibly refreshed data for the client.

This method provides the primary means of applying data updates from the client back to the server, and is invoked when the Update method is called on a client-side remote data adapter component.

function UpdateData(const aDelta: Binary): Binary

Parameters:

  • aDelta: delta list to process

 

OnAcquireConnectionFailure    (declared in TBaseDataAbstractService)

Fired when acquiring a connection failed.

property OnAcquireConnectionFailure: TDAAcquireConnectionFailureEvent read write
delegate: procedure OnAcquireConnectionFailure(aSender: TObject; const aConnectionName: string; aError: Exception)

OnActivate    (declared in TRORemoteDataModule)

Called just after the service is created and before any service method is called. Handle this event for everything you need to do when the service instance is created.

property OnActivate: TActivateEvent read write
delegate: procedure OnActivate(const aClientID: TGUID; aSession: TROSession; const aMessage: IROMessage)

OnAfterAcquireConnection    (declared in TBaseDataAbstractService)

Fires right after a new connection is acquired through the Connection property. Use this event to make perform initializations on the new connection, such as opening a transaction, or setting connection options.

property OnAfterAcquireConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnAfterAcquireConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnAfterExecuteCommand

Fires right after a command was executed.

property OnAfterExecuteCommand: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecuteCommand(aSender: TObject; const aCommand: IDASQLCommand; aRowsAffacted: Integer)

OnAfterGetDatasetData

Fires right after data for a dataset (data table) was retrieved.

property OnAfterGetDatasetData: TDAGetDatasetDataEvent read write
delegate: procedure OnAfterGetDatasetData(aSender: TObject; const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

OnAfterGetDatasetSchema

Fires right after schema info for a dataset (data table) was retrieved.

property OnAfterGetDatasetSchema: TDAGetDatasetSchemaEvent read write
delegate: procedure OnAfterGetDatasetSchema(aSender: TObject; const aDataset: IDADataset)

OnAfterProcessDeltas

Fires right after Deltas for a data table have been processed.

property OnAfterProcessDeltas: TDAProcessDeltasEvent read write
delegate: procedure OnAfterProcessDeltas(aSender: TObject; aDeltaStructs: TDADeltaStructList)

OnAfterReleaseConnection    (declared in TBaseDataAbstractService)

Fires right after a connection is released.

property OnAfterReleaseConnection: TDAConnectionReleasedEvent read write
delegate: procedure OnAfterReleaseConnection(aSender: TObject; const aConnectionName: string)

OnBeforeAcquireConnection    (declared in TBaseDataAbstractService)

Fires just before a new connection is acquired through the Connection property. Use this event to make last-minute configurations before the connection will be acquired, such as changing the ConnectionName.

property OnBeforeAcquireConnection: TDAAcquireConnectionEvent read write
delegate: procedure OnBeforeAcquireConnection(aSender: TObject; var aConnectionName: string)

OnBeforeExecuteCommand

Fires just before a command will be executed.

property OnBeforeExecuteCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteCommand(aSender: TObject; const aCommand: IDASQLCommand)

OnBeforeExecuteDeltaCommand

Fires just before a delta command will be executed.

property OnBeforeExecuteDeltaCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteDeltaCommand(const Sender: IDASQLCommand)

OnBeforeGetDatasetData

Fires just before data for a dataset (data table) is retrieved.

property OnBeforeGetDatasetData: TDAGetDatasetDataEvent read write
delegate: procedure OnBeforeGetDatasetData(aSender: TObject; const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

OnBeforeGetDatasetSchema

Fires just before schema info for a dataset (data table) is retrieved.

property OnBeforeGetDatasetSchema: TDAGetDatasetSchemaEvent read write
delegate: procedure OnBeforeGetDatasetSchema(aSender: TObject; const aDataset: IDADataset)

OnBeforeGetTableData

This event allows to provide additional Dynamic Where expression.

property OnBeforeGetTableData: TDABeforeGetTableData read write
delegate: procedure OnBeforeGetTableData(aSender: TObject; aTableName: string; var aAdditionalWhere: TDAWhereExpression)

OnBeforeProcessDeltas

Fires just before Deltas for a data table will be processed.

property OnBeforeProcessDeltas: TDAProcessDeltasEvent read write
delegate: procedure OnBeforeProcessDeltas(aSender: TObject; aDeltaStructs: TDADeltaStructList)

OnBeforeRegisterEventClient    (declared in TRORemoteDataModule)

Called when the new client is being registered to receive events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeRegisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeRegisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBeforeReleaseConnection    (declared in TBaseDataAbstractService)

Fires just before the connection is released. Use this event to perform any finalization tasks on the new connection, such as closing a transaction, or setting connection options.

property OnBeforeReleaseConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnBeforeReleaseConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnBeforeUnregisterEventClient    (declared in TRORemoteDataModule)

Called when the client is being unsubscribed from events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeUnregisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeUnregisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBusinessProcessorAutoCreated

Fires whenever a new TDABusinessProcessor was auto-created to process deltas. You can use this event to perform additional configuration on the Business Processor before it will be used.

property OnBusinessProcessorAutoCreated: TDABusinessProcessorAutoCreatedEvent read write
delegate: procedure OnBusinessProcessorAutoCreated(aSender: TRORemoteDataModule; BusinessProcessor: TDABusinessProcessor)

OnDeactivate    (declared in TRORemoteDataModule)

Called after the service method completes and before the service instance is freed. Handle this event to perform actions on service destruction, such as disposing of resources.

property OnDeactivate: TDeactivateEvent read write
delegate: procedure OnDeactivate(const aClientID: TGUID; aSession: TROSession)

OnGetDispatchInfo    (declared in TRORemoteDataModule)

This event is fired before the invoker executes the service method. Handle this event to preview remote methods about to be executed; the input parameters allow to get all information about the upcoming call including the remote method parameters and the calling client transport object.

property OnGetDispatchInfo: TGetDispatchInfoEvent read write
delegate: procedure OnGetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

OnGetSchemaAsXMLEvent

Fires whenever a client retrieves the ServiceSchema. You can use this event to manually adjust or filter the Schema XML before it will be returned to the client.

property OnGetSchemaAsXMLEvent: TDAGetSchemaAsXMLEvent read write
delegate: procedure OnGetSchemaAsXMLEvent(aSender: TObject; var aSchemaXML: ROUTF8String)

OnProcessDeltasError

Fires if an error occurred while processing Deltas. Among other things, you can use this event to determine whether processing of the remaining Delta changes should continue, or if all changes should be rejected.

property OnProcessDeltasError: TDAProcessDeltasErrorEvent read write
delegate: procedure OnProcessDeltasError(aSender: TObject; aDeltaStructs: TDADeltaStructList; aError: Exception; var aDoRaise: Boolean)

OnUnknownSqlMacroIdentifier    (declared in TBaseDataAbstractService)

Fires when unknown macro variable is found. it can be usable when user-defined variables are used inside sql or Dynamic Where expression.

property OnUnknownSqlMacroIdentifier: TOnUnknownIdentifier read write
delegate: function OnUnknownSqlMacroIdentifier(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnUpdateDataBeginTransaction

Fires when a transaction will be started for processing a new set of deltas. You can handle this event to determine if the transaction should be started (default) or not.

property OnUpdateDataBeginTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataBeginTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnUpdateDataCommitTransaction

Fires when a transaction used for processing Deltas will be committed. You can handle this event to determine if the transaction should be committed (default) or not.

property OnUpdateDataCommitTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataCommitTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnUpdateDataRollBackTransaction

Fires when a transaction used for processing Deltas will be rolled back due to errors. You can handle this event to determine if the transaction should be rolled back (default) or not.

property OnUpdateDataRollBackTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataRollBackTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnValidateCommandExecution

Fires before a command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.

property OnValidateCommandExecution: TDASchemaElementAccessValidationEvent read write
delegate: procedure OnValidateCommandExecution(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of Variant; aSchema: TDASchema; var Allowed: Boolean)

OnValidateDatasetAccess

Fires before a data access retrieves data tables. You can use this event handler to do validation, for example to check if the current user is allowed to access the data table(s) in question, and raise an exception if the data access should be aborted.

property OnValidateDatasetAccess: TDASchemaElementAccessValidationEvent read write
delegate: procedure OnValidateDatasetAccess(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of Variant; aSchema: TDASchema; var Allowed: Boolean)

OnValidateDirectSQLAccess

Fires before a SQL command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.

property OnValidateDirectSQLAccess: TDASQLValidationEvent read write
delegate: procedure OnValidateDirectSQLAccess(Sender: TObject; const aConnection: IDAConnection; const aSQLText: string; const aParamNames: array of string; const aParamValues: array of Variant; var Allowed: Boolean)

OnValidateRoles    (declared in TRORemoteDataModule)

Validates roles.

property OnValidateRoles: TValidateRolesEvent read write
delegate: procedure OnValidateRoles(aRoles: array of string; var aAllow: Boolean)