Change timeout for loading log records

If loading log records from an external MS SQL database exceeds a certain timeout, Adaxes stops loading the records with the following error message: Failed to load log records. Timeout expired. To change the timeout, use the below script.

Note

Only Adaxes service administrators have the rights to change the timeout for loading log records.

In the script:

  • $serviceHost - the host name of the computer where the Adaxes service is installed.
  • $timeoutSec - the amount of time (in seconds) Adaxes will wait for log records to load.
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$timeoutSec = 60

# Connect to the Adaxes service.
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Configuration Set Settings' container.
$path = $admService.Backend.GetConfigurationContainerPath("ConfigurationSetSettings")
$settings = $admService.OpenObject($path, $credential.UserName,`
    $credential.GetNetworkCredential().Password, 0)

# Update the timeout.
$settings.SetParameter("Logging.SqlQueryTimeout", $timeoutSec)

View the current timeout

To view the current timeout, use the below script. In the script, the $serviceHost variable specifies the host name of the computer where the Adaxes service is installed.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"

# Connect to the Adaxes service.
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Configuration Set Settings' container.
$path = $admService.Backend.GetConfigurationContainerPath("ConfigurationSetSettings")
$settings = $admService.OpenObject($path, $credential.UserName,`
    $credential.GetNetworkCredential().Password, 0)

Write-Host "Timeout for loading log records is "`
    $settings.GetParameter("Logging.SqlQueryTimeout") " seconds"