Datasnap.DSServer.TDSServerClass

From RAD Studio API Documentation
Jump to: navigation, search

Datasnap.DSCommonServer.TDSCustomServerClassDatasnap.DSCommonServer.TDSServerComponentSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTDSServerClass

Delphi

TDSServerClass = class(TDSCustomServerClass)

C++

class PASCALIMPLEMENTATION TDSServerClass : public Datasnap::Dscommonserver::TDSCustomServerClass

Properties

Type Visibility Source Unit Parent
class public
Datasnap.DSServer.pas
Datasnap.DSServer.hpp
Datasnap.DSServer Datasnap.DSServer

Description

Component used to specify a server-side class with published methods that can be called from a remote client using dynamic method invocation.

TDSServerClass is a component that can be used to specify a server-side class with published methods that can be called from a remote client using dynamic method invocation.

Methods in this class can be called from remote clients, such as the DBX Client Provider or the ADO.NET provider.

Server-side classes that extend TRemoteDataModule can also be specified so that the providers they contain can be accessed by a client-side TDSProviderConnection client component.

The parameter and return types of the published server class methods supported include most of the dbExpress value types that extend from TDBXValue scalar values, TDBXReader and TStream objects.

Parameter Types Supported

Currently, using a TDBXValue is the fastest way to pass a parameter, because these are the internal objects used to manage parameter lists. When these parameter types are specified, the internal TDBXValue is passed directly to the application. Note, however, that since this is treated as a TDBXParameterDirections.IN_OUT_PARAMETER parameter, an application may want to call TDBXWritableValue.SetNull before returning from a method where the value can be large. Otherwise the value is sent back to the remote client.

The following list contains TDBXValue types that can be used as parameters:

The following list contains JSON-specific types that can be used as parameters:

Both var and out scalar value or string types are supported.

A server method's var parameters are treated as TDBXParameterDirections.IN_OUT_PARAMETER by a database client driver. A server method's out parameters are treated as TDBXParameterDirections.OUT_PARAMETER by a database client driver.

The following list contains the scalar value types supported:

The in and return scalar value types are supported.

A server method's in parameter is treated as a TDBXParameterDirections.IN_PARAMETER by a database client driver. A server method's return parameter is treated as a TDBXParameterDirections.RETURN_PARAMETER by a database client driver. The return value is available to the database driver client as the last parameter in the command's parameter list.

This list includes all of the scalar values that can be passed as var and out parameters, plus the following additional data types:

Currently, TBcd and TSQLTimeStamp values can only be passed using TDBXBcdValue and TDBXTimeStampValue parameters.

Also, any object that is derived from TObject can be passed as var and out parameters.

Shared Database Connection

A server method can share access to a database connection with a client connection. A client connection can have only one association with a server-side database connection at a time. This database connection sharing with the client and server methods allows the client to execute SQL statements and SQL stored procedures using the same database connection and transactional context as the server methods that the client makes calls to. A client can share a database connection with a server method by calling a server method that returns a TDBXConnection instance. The TDBXConnection instance is not actually returned to the client. Instead, the TDBXConnection instance is used for all SQL statement and SQL stored procedure commands that are executed by the client. For convenience, this server method can be specified by setting the TDBXPropertyNames.ServerConnection property to the name of a server method that returns a TDBXConnection instance.

See Also