• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Edit
Show / Hide Table of Contents

NetServer Data element

•
Environment: onsite
Some tooltip text!
• 9 minutes to read
 • 9 minutes to read

The data configuration section contains subsections for managing the database connection and session handling. Combined, these sections define which server and database the caller will connect as well as what state settings to use.

<Data>
  <Database>
    <add key="DatabaseMajor" value="MSSQL" />
    <add key="DatabaseMinor" value="14" />
    <add key="Server" value="" />
    <add key="Database" value="" />
    <add key="CommandTimeOut" value="300" />
    <add key="TablePrefix" value="crm7" />
    <add key="ConnectionString" value="Server=[@Server];Database=[@Database];User ID=[@User];Password=[@Password]" />

    <!-- Sybase -->
    <add key="DynamicLoadedConnectionType" value="iAnywhere.Data.AsaClient.AsaConnection" />
    <add key="DynamicLoadedDataBaseDriver" value="C:\Program Files\Sybase\SQL Anywhere 9\win32\iAnywhere.Data.AsaClient.dll" />
    <add key="DynamicLoadedDataBaseDriverPolicy" value="C:\Program Files\Sybase\SQL Anywhere 9\win32\policy.9.0.iAnywhere.Data.AsaClient.dll" />

    <!-- **** LEGACY **** IBM DB2 -->
    <add key="DynamicLoadedConnectionType" value="IBM.Data.DB2.DB2Connection" />
    <add key="DynamicLoadedDataBaseDriver" value="C:\Program Files\IBM\SQLLIB\BIN\netf11\IBM.Data.DB2.dll" />
    <add key="DynamicLoadedDataBaseDriverPolicy" value="C:\Program Files\IBM\SQLLIB\BIN\netf11\policy.8.1.IBM.Data.DB2.dll" />
  </Database>
  <Explicit>
    <add key="PartnerAllowed" value="True" />
    <add key="EmployeeAllowed" value="True" />
    <add key="SystemAllowed" value="True" />
    <add key="AnonymousAllowed" value="True" /> <!--  Added v8.5 -->
    <add key="DBUser" value="" />
    <add key="DBPassword" value="" />
    <add key="CommonDBConnection" value="True" />
  </Explicit>
  <!-- <ImplicitAnonymous /> removed in v 8.5 -->
  <Session>
    <add key="Mode" value="Thread" />
    <add key="ReauthenticateOnDeserialization" value="false" />
  </Session>
</Data>

Database

Configuration values for database connectivity define the location and database-vendor-specific settings. Supported database servers include SQL Server and Oracle and the values will look slightly different depending on which vendor you use.

Name Description Default
CacheCheckInterval Number of seconds to check if caches are outdated and need to be refreshed. 0 will disable the timer.
CommandTimeout Timeout in seconds for the command to wait for a response from the database.
ConnectionString The formatted connection string template placeholders (Server=[@Server];Database=[@Database];User ID=[@User];Password=[@Password]). The number of parameters in the ConnectionString key will vary from one database vendor software to another, so will the names of the parameters. Vendor database software differences must be taken into consideration when setting this configuration key. The above example displays the configurations for an MSSQL database.
DatabaseMajor Major name of database provider. Options: MSSQL, Oracle, Sybase, and DB2 (legacy only).
DatabaseMinor Version number of database.
DatabaseName Name of the database. Also used for a distinct service name.
DefaultReadUncommitted Should SELECTs by default run in "ReadUncommitted" isolation level, lessening locking contention (especially on SQL Server)? true
DisableSqlTrackingComments If true, then comments that usually precede generated SQL to identify the operation and user will not be generated at all; may help performance on Oracle which thinks it has to re-parse everything if a comment changes. false
DisableUserInSqlTrackingComments If true, then comments that usually precede generated SQL to identify the operation will not contain associate information; may help performance on Oracle which thinks it has to re-parse everything if a comment changes. false
ForceCacheRefreshInterval Number of seconds before caches are force refreshed. 0 will disable the timer.
ImpersonateDatabaseUser Should the DbUser be logged in with windows and impersonated when connecting to the database to support database integrated authentication. false
Server The server name where the database is located.
TablePrefix The prefix of the SuperOffice CRM tables in the database.

Sybase-specific settings:

Name Description Default
DynamicLoadedConnectionType The type of connection to open.
DynamicLoadedDataBaseDriver The name of the ADO.NET driver to load.
DynamicLoadedDataBaseDriverPolicy The location of the policy file.

Explicit

Configuration section for authentication behavior when users are explicitly authenticated, typically by calling SoSession.Authenticate or the corresponding WCF service. Relates to employee and partner access to the SuperOffice database.

The Explicit section allows an application to determine what type of users are authorized to use this application, as well as must set the database credentials, which map to both a database server user and a SuperOffice system user.

Name Description Default
AnonymousAllowed Is anonymous user access allowed? false
CommonDBConnection Use the same connection string for all users, applying the common User and Password from this section, vs. using the one provided elsewhere. true
DBPassword Database user password.
DBUser Database user when running on behalf of explicitly authenticated users
EmployeeAllowed Is employee access allowed? true
ExternalPersonAllowed Is an external person allowed access?
PartnerAllowed Is partner access allowed?
SystemAllowed Is system user access allowed?

CommonDBConnection

If this value is "True", DBUser and DBPassword are used in the database connection.

Otherwise, the credentials provided in the authentication (for example SoSession class) will be used.

True is the default for server applications (Web), and False is the default for client applications (Windows forms).

ImplicitAnonymous (deprecated)

This section relates to anonymous access to the SuperOffice database. It is what you get when you don't explicitly authenticate as a user. Usually disabled in SO.web, which uses explicit users.

Note

The ImplicitAnonymous section was removed in version 8.5.

Name Description
Allowed Is anonymous access is permitted?
DBPassword The password used to connect to the database.
DBUser The database user (not the CRM5 user) used to connect to the database.
SoPassword The SuperOffice CRM5 user password.
SoUser The SuperOffice CRM5 username of the Anonymous user.

Session

This section governs session handling: how the authenticated session will exist at runtime, the scope/storage of the session state. This relates to the lifetime of a NetServer communication session, such as the duration of a transaction, or group of transactions, and maintains the credentials defined in one of the following sections.

Name Description
Mode The mode of the session: Thread, Context, HttpContext, Process.
Maps to a class name that provides session storage.
ReauthenticateOnDeserialization A full re-authentication is carried out each time the session is de-serialized (such as from the session server).

Each session option determines where in memory the authenticated session will be available from.

Mode Availability of authenticated SoSession
Process to all synchronization contexts and threads
Context only to routines passed to the same synchronization context
Thread only on that thread - if another non-authenticated thread tried to use the SuperOffice API to get data, NetServer would throw an exception.
  • Thread: Every session requires the suspend and continue methods to be called for each query task. Here, each thread executed in NetServer will have sessions that are stored in the implication of different threads and have different session values stored in them. If you want to suspend a session, you must call the suspend method which returns a string with the session values. Should you wish to continue that session, you must call the continue method and pass the string with session values in it as a parameter. The session is stored in a thread-static manner.  Each executing thread has a separate instance of the session. If the session is accessed on a different thread, it will contain a different value. For further reference, see System.ThreadStaticAttribute.

  • Context: Your session requires only authentication and a closure. Here, once you authenticate a session, it will be for the lifetime of the session. It is not necessary to call continue and suspend methods. The session values for this configuration will be stored in a context-static manner. For further reference, see System.ContextStaticAttribute.

  • Process: Session is stored in a process-static manner. This is the normal option for Windows applications.

  • HttpContext: Recommended in ASP.NET applications. Added to prevent ASP.NET thread switches from changing identities in the middle of an ASP.net request.

See the NetServer Core reference for details about handling this programmatically.

In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top