The default session properties are suitable for most c-treeDB .NET applications. Advanced developers may need to tune c-treeDB .NET to meet application requirements. Use CTSession.SetSessionParams() to set the following properties:
Default Session Parameters
Property |
Explanation |
Default |
---|---|---|
SESSION_PARAM.BUFS |
Index file buffers |
10 |
SESSION_PARAM.FILS |
File structure blocks |
32 |
SESSION_PARAM.SECT |
Node sectors |
32 |
SESSION_PARAM.DBUFS |
Data file buffers |
10 |
SESSION_PARAM.USERPROF |
User profile mask |
513 |
The default SESSION_PARAM.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 to remove the automatic key transformation.
The table below presents all possible values for the SESSION_PARAM.USERPROF parameter.
User Profile Values (USER_PROF enum)
Keyword |
Value |
Explanation |
---|---|---|
NTKEY |
1 |
Do not perform auto tfrmkey |
SAV_ENV |
2 |
Savenv mode for transactions |
SQL |
4 |
Enable SQL support |
SERIAL |
8 |
Enable strict serialization |
NDATA |
32 |
Do not perform auto date - UNIFRMAT conversion |
LOCLIB |
64 |
Use a local library, not server |
PTHTMP |
128 |
Add tmpname to input path, otherwise use system tmpname |
CODCNV |
256 |
Auto language conversion |
CLRCHK |
512 |
Clear transaction logs |
CUSTOM |
1024 |
Custom server application |
ENCRYPT |
2048 |
Enable encryption |
Example
// set a different user profile before logging on to a session
CTSession ASession = new CTSession();
try
{
// set the new profile
ASession.SetParam(SESSION_PARAM.USERPROF, (USER_PROF.NTKEY |
USER_PROF.CLRCHK));
// logon to a session
ASession.Logon("FAIRCOMS", "ADMIN", "ADMIN");
}
catch (CTException err)
{
Console.Write("Session logon failed with error {0}\n", err.GetErrorCode());
}