BaseDataAdapter
Overview
The BaseDataAdapter is a base class for all data adapters (both Local Data Adapters and Remote Data Adapters) available in the Data Abstract for .NET. This class doesn't provide any real data access functionality. Instead it provides several utility methods and common infrastructure used by all data adapters.
This class cannot be instantiated directly.
Location
- Reference: RemObjects.DataAbstract.dll
- Namespace: RemObjects.DataAbstract
- Ancestry: BaseComponent | BaseDataAdapter | Descendants
Implements
constructor protected
Creates a new instance of the BaseDataAdapter class and performs the license check.
constructor
BaseDataAdapter()
Sub New
constructor (Boolean) protected
Creates a new instance of the BaseDataAdapter class and performs the license check unless the avoidLicenseCheck argument is set to true.
constructor(avoidLicenseCheck: Boolean)
BaseDataAdapter(Boolean avoidLicenseCheck)
Sub New (avoidLicenseCheck As Boolean)
Parameters:
- avoidLicenseCheck: Flag indicating whether license chec can be skipped
constructor (IContainer) protected
Creates a new instance of the BaseDataAdapter class, performs the license check and then adds the newly created instance to the provided component container.
constructor(container: IContainer)
BaseDataAdapter(IContainer container)
Sub New (container As IContainer)
Parameters:
- container: Components container that will contain the instance being created
AcceptChangesDuringFill
Gets or sets a flag indicating whether all target DataTable changes made during data retrieval from the Data Abstract server should be commited. If this property is set to false then some or all data rows in the target DataTable will be marked as updated or inserted after the Fill operation is completed.
The default value is true.
property AcceptChangesDuringFill: Boolean read write;
Boolean AcceptChangesDuringFill { get; set; }
Property AcceptChangesDuringFill As Boolean
AcceptChangesDuringUpdate
Gets or sets a flag indicating whether all DataTable changes should be automatically commited after the update data is sent to the Data Abstract server should be commited. If this property is set to false then data rows in the target DataTable will remain to be marked as updated or inserted after the Update operation is completed.
The default value is true.
property AcceptChangesDuringUpdate: Boolean read write;
Boolean AcceptChangesDuringUpdate { get; set; }
Property AcceptChangesDuringUpdate As Boolean
AutoLoadScripts
Gets or sets flag indicating whether Business Rules Scripting API scripts should be automaically downloaded from the Data Abstract server when the data is retreved from the server.
property AutoLoadScripts: Boolean read write;
Boolean AutoLoadScripts { get; set; }
Property AutoLoadScripts As Boolean
BeginInit
method BeginInit
void BeginInit()
Sub BeginInit
BeginInternalUpdate protected
Starts asynchronous data update operation.
method BeginInternalUpdate(deltas: array of Delta; cb: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginInternalUpdate(Delta[] deltas, AsyncCallback cb, Object state)
Function BeginInternalUpdate(deltas As array of Delta, cb As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- deltas: Collection of Delta instances that will be send to the Data Abstract server
- cb: Callback method that will be called once the asynchronous data update call is completed
- state: Asynchronous operation state object
CacheSchema
Gets or sets flag indicating whether Schema retrieved from the server via the ReadSchema method call should be chached in the Schema property. Setting this property to false can significantly decrease performance.
The default value is true.
property CacheSchema: Boolean read write;
Boolean CacheSchema { get; set; }
Property CacheSchema As Boolean
CheckAdapterSettings protected
Performs required internal data adapter initialization before issuing a data read or update request.
method CheckAdapterSettings
void CheckAdapterSettings()
Sub CheckAdapterSettings
CheckFailures protected
Composes the data update failure message based on the Delta information returned from the server after the Udate call.
method CheckFailures(delta: Delta; changes: List<DeltaChange>; failureMessage: StringBuilder)
void CheckFailures(Delta delta, List<DeltaChange> changes, StringBuilder failureMessage)
Sub CheckFailures(delta As Delta, changes As List<DeltaChange>, failureMessage As StringBuilder)
Parameters:
- delta: Delta instance returned from the Data Abstract server
- changes: Collection that will contain a list of the DeltaChange instances that server marked as ChangeStatus
- failureMessage: String builder instace that will contain composed data update failure message
DynamicSelect
Gets or sets a flag indicating whether Data Adapter should perform queries using the Dynamic Select feature
property DynamicSelect: Boolean read write;
Boolean DynamicSelect { get; set; }
Property DynamicSelect As Boolean
EndInit
method EndInit
void EndInit()
Sub EndInit
EndInternalUpdate protected
Finishes the asynchronous data update operation and performs needed cleanup actions, f.e. merges back updated AutoInc values retrieved from the server.
method EndInternalUpdate(ar: IAsyncResult)
void EndInternalUpdate(IAsyncResult ar)
Sub EndInternalUpdate(ar As IAsyncResult)
Parameters:
- ar: Object representing the status of an asynchronous operation
EnterCriticalSection protected
method EnterCriticalSection(status: DataAdapterStatus)
void EnterCriticalSection(DataAdapterStatus status)
Sub EnterCriticalSection(status As DataAdapterStatus)
Parameters:
- status:
ExitCriticalSection protected
This method is called on exiting a method or code region that should be accessed by a single thread only at any given moment of time.
This method sets the Status property to RemoteAdapterStatus.Idle and then releases the critical code section lock.
method ExitCriticalSection
void ExitCriticalSection()
Sub ExitCriticalSection
FailureBehavior
Gets or sets intended Data Adapter behavior on data update errors.
property FailureBehavior: FailureBehavior read write;
FailureBehavior FailureBehavior { get; set; }
Property FailureBehavior As FailureBehavior
FlushSchema
Cleans up the Schema cache and sets the Schema to null.
method FlushSchema
void FlushSchema()
Sub FlushSchema
GetSchemaOnFirstFill
Gets or sets a flag indicating whether Schema should be downloaded from the remote Data Abstract server right before the first data request.
The default value is true.
property GetSchemaOnFirstFill: Boolean read write;
Boolean GetSchemaOnFirstFill { get; set; }
Property GetSchemaOnFirstFill As Boolean
LoadScripts
Downloads Business Rules Scripting API scripts from the server.
In its current implementation this method downloads entire Schema from the Data Abstract server.
method LoadScripts
void LoadScripts()
Sub LoadScripts
ReadSchema
Downloads the Schema from the Data Abstract server .
method ReadSchema(forceRefresh: Boolean): Schema
Schema ReadSchema(Boolean forceRefresh)
Function ReadSchema(forceRefresh As Boolean) As Schema
Parameters:
- forceRefresh: Flag indicating whether Schema should be downloaded even if the Schema is already cached in the Schema property
ReadStreamerSchema protected
Downloads the Schema from the Data Abstract server. This method is used when the server exposes the Schema using method that sends it using highly-optimized binary stream (opposing to the ReadSchema method that is called when the server exposes its Schema as Xml).
Schema
Gets the Schema currently cached by the Data Adapter instance
property Schema: Schema read;
Schema Schema { get; }
Property ReadOnly Schema As Schema
ScriptProvider
Gets or sets Business Rules Scripting API provided that will be used to execute client-side scripts.
property ScriptProvider: IScriptProvider read write;
IScriptProvider ScriptProvider { get; set; }
Property ScriptProvider As IScriptProvider
Status
Gets current status of the Data Adapter
property Status: DataAdapterStatus read;
DataAdapterStatus Status { get; }
Property ReadOnly Status As DataAdapterStatus
AcceptChangesDuringFill
Gets or sets a flag indicating whether all target DataTable changes made during data retrieval from the Data Abstract server should be commited. If this property is set to false then some or all data rows in the target DataTable will be marked as updated or inserted after the Fill operation is completed.
The default value is true.
property AcceptChangesDuringFill: Boolean read write;
Boolean AcceptChangesDuringFill { get; set; }
Property AcceptChangesDuringFill As Boolean
AcceptChangesDuringUpdate
Gets or sets a flag indicating whether all DataTable changes should be automatically commited after the update data is sent to the Data Abstract server should be commited. If this property is set to false then data rows in the target DataTable will remain to be marked as updated or inserted after the Update operation is completed.
The default value is true.
property AcceptChangesDuringUpdate: Boolean read write;
Boolean AcceptChangesDuringUpdate { get; set; }
Property AcceptChangesDuringUpdate As Boolean
AutoLoadScripts
Gets or sets flag indicating whether Business Rules Scripting API scripts should be automaically downloaded from the Data Abstract server when the data is retreved from the server.
property AutoLoadScripts: Boolean read write;
Boolean AutoLoadScripts { get; set; }
Property AutoLoadScripts As Boolean
CacheSchema
Gets or sets flag indicating whether Schema retrieved from the server via the ReadSchema method call should be chached in the Schema property. Setting this property to false can significantly decrease performance.
The default value is true.
property CacheSchema: Boolean read write;
Boolean CacheSchema { get; set; }
Property CacheSchema As Boolean
DynamicSelect
Gets or sets a flag indicating whether Data Adapter should perform queries using the Dynamic Select feature
property DynamicSelect: Boolean read write;
Boolean DynamicSelect { get; set; }
Property DynamicSelect As Boolean
FailureBehavior
Gets or sets intended Data Adapter behavior on data update errors.
property FailureBehavior: FailureBehavior read write;
FailureBehavior FailureBehavior { get; set; }
Property FailureBehavior As FailureBehavior
GetSchemaOnFirstFill
Gets or sets a flag indicating whether Schema should be downloaded from the remote Data Abstract server right before the first data request.
The default value is true.
property GetSchemaOnFirstFill: Boolean read write;
Boolean GetSchemaOnFirstFill { get; set; }
Property GetSchemaOnFirstFill As Boolean
Schema
Gets the Schema currently cached by the Data Adapter instance
property Schema: Schema read;
Schema Schema { get; }
Property ReadOnly Schema As Schema
ScriptProvider
Gets or sets Business Rules Scripting API provided that will be used to execute client-side scripts.
property ScriptProvider: IScriptProvider read write;
IScriptProvider ScriptProvider { get; set; }
Property ScriptProvider As IScriptProvider
Status
Gets current status of the Data Adapter
property Status: DataAdapterStatus read;
DataAdapterStatus Status { get; }
Property ReadOnly Status As DataAdapterStatus
constructor protected
Creates a new instance of the BaseDataAdapter class and performs the license check.
constructor
BaseDataAdapter()
Sub New
constructor (Boolean) protected
Creates a new instance of the BaseDataAdapter class and performs the license check unless the avoidLicenseCheck argument is set to true.
constructor(avoidLicenseCheck: Boolean)
BaseDataAdapter(Boolean avoidLicenseCheck)
Sub New (avoidLicenseCheck As Boolean)
Parameters:
- avoidLicenseCheck: Flag indicating whether license chec can be skipped
constructor (IContainer) protected
Creates a new instance of the BaseDataAdapter class, performs the license check and then adds the newly created instance to the provided component container.
constructor(container: IContainer)
BaseDataAdapter(IContainer container)
Sub New (container As IContainer)
Parameters:
- container: Components container that will contain the instance being created
BeginInit
method BeginInit
void BeginInit()
Sub BeginInit
BeginInternalUpdate protected
Starts asynchronous data update operation.
method BeginInternalUpdate(deltas: array of Delta; cb: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginInternalUpdate(Delta[] deltas, AsyncCallback cb, Object state)
Function BeginInternalUpdate(deltas As array of Delta, cb As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- deltas: Collection of Delta instances that will be send to the Data Abstract server
- cb: Callback method that will be called once the asynchronous data update call is completed
- state: Asynchronous operation state object
CheckAdapterSettings protected
Performs required internal data adapter initialization before issuing a data read or update request.
method CheckAdapterSettings
void CheckAdapterSettings()
Sub CheckAdapterSettings
CheckFailures protected
Composes the data update failure message based on the Delta information returned from the server after the Udate call.
method CheckFailures(delta: Delta; changes: List<DeltaChange>; failureMessage: StringBuilder)
void CheckFailures(Delta delta, List<DeltaChange> changes, StringBuilder failureMessage)
Sub CheckFailures(delta As Delta, changes As List<DeltaChange>, failureMessage As StringBuilder)
Parameters:
- delta: Delta instance returned from the Data Abstract server
- changes: Collection that will contain a list of the DeltaChange instances that server marked as ChangeStatus
- failureMessage: String builder instace that will contain composed data update failure message
EndInit
method EndInit
void EndInit()
Sub EndInit
EndInternalUpdate protected
Finishes the asynchronous data update operation and performs needed cleanup actions, f.e. merges back updated AutoInc values retrieved from the server.
method EndInternalUpdate(ar: IAsyncResult)
void EndInternalUpdate(IAsyncResult ar)
Sub EndInternalUpdate(ar As IAsyncResult)
Parameters:
- ar: Object representing the status of an asynchronous operation
EnterCriticalSection protected
method EnterCriticalSection(status: DataAdapterStatus)
void EnterCriticalSection(DataAdapterStatus status)
Sub EnterCriticalSection(status As DataAdapterStatus)
Parameters:
- status:
ExitCriticalSection protected
This method is called on exiting a method or code region that should be accessed by a single thread only at any given moment of time.
This method sets the Status property to RemoteAdapterStatus.Idle and then releases the critical code section lock.
method ExitCriticalSection
void ExitCriticalSection()
Sub ExitCriticalSection
FlushSchema
Cleans up the Schema cache and sets the Schema to null.
method FlushSchema
void FlushSchema()
Sub FlushSchema
LoadScripts
Downloads Business Rules Scripting API scripts from the server.
In its current implementation this method downloads entire Schema from the Data Abstract server.
method LoadScripts
void LoadScripts()
Sub LoadScripts
ReadSchema
Downloads the Schema from the Data Abstract server .
method ReadSchema(forceRefresh: Boolean): Schema
Schema ReadSchema(Boolean forceRefresh)
Function ReadSchema(forceRefresh As Boolean) As Schema
Parameters:
- forceRefresh: Flag indicating whether Schema should be downloaded even if the Schema is already cached in the Schema property
ReadStreamerSchema protected
Downloads the Schema from the Data Abstract server. This method is used when the server exposes the Schema using method that sends it using highly-optimized binary stream (opposing to the ReadSchema method that is called when the server exposes its Schema as Xml).