Previous Topic

Next Topic

Session properties

The default session properties are suitable for most c-treeDB applications. Advanced developers may need to tune c-treeDB to meet application requirements. Use CTSession::SetSessionParams() to set the following properties:

Table 3-1: Default Session Parameters

Property

Explanation

Default

BUFS

Index file buffers

10

FILS

File structure blocks

32

SECT

Node sectors

32

DBUFS

Data file buffers

10

USERPROF

User profile mask

513

The default USERPROF value of 513 tells single-user, transaction-control applications, to remove the auxiliary log files S*.FCS and L*.FCS upon successful termination of the application, and also removes the automatic key transformation.

The table below present all possible values for the USERPROF parameter.

Table 3-2: User Profile Values

Keyword

Value

Explanation

USERPRF_NTKEY

1

Do not perform auto tfrmkey

USERPRF_SAVENV

2

Savenv mode for transactions

USERPRF_SQL

4

Enable SQL support

USERPRF_SERIAL

8

Enable strict serialization

USERPRF_MEMABS

10

Internal memory management

USERPRF_NDATA

32

Do not perform auto data - UNIFRMAT conversion

USERPRF_LOCLIB

64

Use a local library: not server

USERPRF_PTHTMP

128

Add tmpname to input path, otherwise use system tmpname

USERPRF_CODCNV

256

Auto language conversion

USERPRF_CLRCHK

512

Clear transaction logs

USERPRF_CUSTOM

1024

Custom server application

USERPRF_ENCRYPT

2048

Enable encryption

USERPRF_ADMSPCL

4096

Full admin logon

Example


// set a different user profile before logging on to a session
CTSession ASession;
try
{
   // set the new profile
   ASession.SetSessionParam(USERPROF, (USERPRF_NTKEY | USERPROF_CLRCHK));
   
// logon to a session
   ASession.Logon(“FAIRCOMS”, “ADMIN”, “ADMIN”);
}
catch (CTException &err)
{
	printf(“Session logon failed with error %d\n”, err.GetErrorCode());
}