OpenPetra
Free Administration Software for Non-Profits
Ict.Common.DB.TServerBusyHelper Class Reference

Helper Class for dealing with 'server busy' state (which can occur due to the prevention of multi-threading DB access problems). More...

Static Public Member Functions

static void CoordinatedAutoRetryCall (string AContext, ref bool AServerCallSuccessful, Action AEncapsulatedServerCallCode, bool AWhenNotSuccessfulThrowSpecialException=false, string AExceptionMessage=null)
 Automatic Retry Handling for Co-ordinated DB Access: Calls the C# Delegate that encapsulates C# code that should be run inside the automatic retry handling scope that this Method provides. It does this a number of times in case the first call didn't work out, and once a set number of retries has been tried it returns (optionally, an Exception can be thrown if the number of retries was exceeded - this gets enabled by setting AWhenNotSuccessfulThrowSpecialException to 'true'). More...
 

Static Public Attributes

static readonly string StrPleaseWaitAFewSecondsManualRetryRequiredGeneric
 todoComment More...
 
static readonly string StrPleaseWaitAFewSecondsManualRetryRequiredCustom
 todoComment More...
 

Detailed Description

Helper Class for dealing with 'server busy' state (which can occur due to the prevention of multi-threading DB access problems).

Another Class, TServerBusyHelperGui in Namespace Ict.Petra.Client.App.Core, derives from this Class and extends it with GUI components related to the 'server-busy'-state.

Member Function Documentation

◆ CoordinatedAutoRetryCall()

static void Ict.Common.DB.TServerBusyHelper.CoordinatedAutoRetryCall ( string  AContext,
ref bool  AServerCallSuccessful,
Action  AEncapsulatedServerCallCode,
bool  AWhenNotSuccessfulThrowSpecialException = false,
string  AExceptionMessage = null 
)
inlinestatic

Automatic Retry Handling for Co-ordinated DB Access: Calls the C# Delegate that encapsulates C# code that should be run inside the automatic retry handling scope that this Method provides. It does this a number of times in case the first call didn't work out, and once a set number of retries has been tried it returns (optionally, an Exception can be thrown if the number of retries was exceeded - this gets enabled by setting AWhenNotSuccessfulThrowSpecialException to 'true').

Parameters
AContextContext that the Method gets called in, eg. name of screen (used only for logging, so don't Catalog.GetString it).
AServerCallSuccessfulControls whether a retry (when false) or no retry (when true) gets performed.
AEncapsulatedServerCallCodeC# Delegate that encapsulates C# code that should be run inside the automatic server call retry handling scope that this Method provides.
AWhenNotSuccessfulThrowSpecialExceptionWhether EDBAutoServerCallRetriesExceededException should be thrown when the maximum number of retries has been exceeded, or not (Default=false). Should only be set to true in specific circumstances - the caller should normally just inspect its Variable that gets passed in into AServerCallSuccessful to evaluate whether the call to this Method was within the retry attempts, or not.
AExceptionMessageOptional message that the an EDBAutoServerCallRetriesExceededException Exception gets raised with. (Default = "").

Member Data Documentation

◆ StrPleaseWaitAFewSecondsManualRetryRequiredCustom

readonly string Ict.Common.DB.TServerBusyHelper.StrPleaseWaitAFewSecondsManualRetryRequiredCustom
static
Initial value:
= Catalog.GetString(
"Please wait a few seconds, then {0} (if you had previously started a long-running action and this is not finished yet, you might need to wait until this is finished).")

todoComment

◆ StrPleaseWaitAFewSecondsManualRetryRequiredGeneric

readonly string Ict.Common.DB.TServerBusyHelper.StrPleaseWaitAFewSecondsManualRetryRequiredGeneric
static
Initial value:
= Catalog.GetString(
"Please wait a few seconds, then retry the action that you wanted to perform (if you had previously started a long-running action and this is not finished yet, you might need to wait until this is finished).")

todoComment


The documentation for this class was generated from the following file: