Server connection attributes are specified in the Server DSN only and are read at first connection. See "Defining Server DSNs" in Oracle TimesTen In-Memory Database Operations Guide. The attributes are used to set the number of connections to a TimesTen server, the number of servers for each DSN and the size of each connection to the server. These attributes allow you to specify multiple client connections to a single Server. By default, TimesTen creates only one connection to a Server per child process.
There are also TimesTen main daemon options that can be used to specify multiple Server connections. In the case that both the daemon options and these attributes have been specified, the value of the attributes takes precedence.
Server connection attributes are listed in Table 1–11, " Server connection attributes"
and described in detail in this section.
Note: These attributes must be specified in the DSN. If these attributes are specified in a connection string, TimesTen ignores them and their values.
MaxConnsPerServer
MaxConnsPerServer
The MaxConnsPerServer attribute sets the maximum number of concurrent connections to the server which the DSN references.
If you want to support many connections to the Server, you must make sure that the per-process file descriptor limit for the UID that TimesTen is being run as is set to a value somewhat more than the number of concurrent child servers that are active. This is the number of anticipated concurrent client connections divided by
MaxConnsPerServer.
The value of this attribute takes precedence over the setting of the value of the-maxConnsPerDSN option in the ttendaemon.options file. For details, see "Specifying multiple connections to the TimesTen Server" in Oracle TimesTen In-Memory Database Operations Guide.
For limits on the maximum number of connections to a TimesTen data store, see the "System Limits" chapter in the Oracle TimesTen In-Memory Database System Tables and Limits Reference.
Required privilege
Only a user with operating system privileges on the system DSN in which this attribute is defined can change the value of this attribute to a value other than the one currently in effect.
Setting
Set MaxConnsPerServer as follows:
Where to set the attribute
How the attribute is
represented Setting
C or Java programs or UNIX ODBC.INI file
MaxConnsPerServer A value between 1 and 2047. The default is 1.
Windows ODBC Data Source Administrator
Maximum Connections Per Server Process field
A value between 1 and 2047. The default is 1.
Data Store Attributes 1-113
ServersPerDSN
The ServersPerDSN attribute specifies the number of DSNs that can connect to a Server DSN at any given time.
The value of this attribute is only meaningful if the value of MaxConnsPerServer is greater than one. If there is only one connection per Server, the child server uses the process' main stack.
This value of this attribute takes precedence over the setting of the value of the
-serversPerDSN option in the ttendaemon.options file. For details, see "Specifying multiple connections to the TimesTen Server" in Oracle TimesTen In-Memory Database Operations Guide.
Required privilege
Only a user with operating system privileges on the system DSN in which this attribute is defined can change the value of this attribute to a value other than the one currently in effect.
Setting
Set ServersPerDSN as follows:
Where to set the attribute
How the attribute is
represented Setting
C or Java programs or UNIX ODBC.INI file
ServersPerDSN A value between 1 and 2047. The default is 1.
Windows ODBC Data Source Administrator
Server Processes Per DSN
field
A value between 1 and 2047. The default is 1.
ServerStackSize
ServerStackSize
The ServerStackSize attribute value determines the size of the stack on the Server for each connection. The value of this attribute is only meaningful if the value of
MaxConnsPerServer is greater than one. If there is only one connection per Server, the child server uses the process' main stack. It is also platform-dependent, as defined in the setting below.
This value of this attribute takes precedence over the setting of the
-serverStackSize option in the ttendaemon.options file. For details, see "Specifying multiple connections to the TimesTen Server" in Oracle TimesTen In-Memory Database Operations Guide.
Required privilege
Only a user with operating system privileges on the system DSN in which this attribute is defined can change the value of this attribute to a value other than the one currently in effect.
Setting
Set ServerStackSize as follows: Where to set the
attribute
How the attribute
is represented Setting
C or Java programs or UNIX ODBC.INI file
ServerStackSize Valid values depend on the platform. The default is 128KB for 32-bit platforms and 256KB for 64-bit platforms.
If the sysconf call is available, the minimum is: sysconf(_SC_THREAD_STACK_MIN)/ 1024 else 0
If the getrlimit call is available, the maximum value is:
getrlimit(RLIMIT_STACK, &r1); r1.rlim_cur /1024
else 4096
The default is 128KB for 32-bit platforms and 256KB for 64-bit platforms.
Windows ODBC Data Source Administrator
Server Stack Size
field
Valid values depend on the platform. The default is 128KB for 32-bit platforms and 256KB for 64-bit platforms.
If the sysconf call is available, the minimum is: sysconf(_SC_THREAD_STACK_MIN)/ 1024 else 0
If the getrlimit call is available, the maximum value is:
2
Built-In Procedures 2-1
2
Built-In Procedures
TimesTen built-in procedures extend standard ODBC and JDBC functionality. You can invoke these procedures using the ODBC or JDBC procedure call interface. The procedure takes the position of the SQL statement, as illustrated in the following examples.
The following ODBC call tells the optimizer that it should not generate temporary hash indexes when preparing commands:
SQLExecDirect (hstmt, (SQLCHAR*)
"{CALL ttOptSetFlag ('TmpHash', 0)}", SQL_NTS);
This is the equivalent JDBC call:
CallableStatement cstmt = con.prepareCall ("{CALL ttOptSetFlag ('TmpHash', 0)}"); cstmt.execute();
TimesTen built-in procedures can also be called from PL/SQL using the EXECUTE IMMEDIATE statement with CALL, as illustrated in the following example. For example, to call the built-in procedure ttConfiguration, create a PL/SQL record type and then SELECT INTO that record type. Because ttConfiguration
returns multiple rows, use BULK COLLECT.
Command> DECLARE
> TYPE ttConfig_record IS RECORD
> (name varchar2(255), value varchar2 (255)); > TYPE ttConfig_table IS TABLE OF ttConfig_record; > v_ttConfigs ttConfig_table;
> BEGIN
> EXECUTE IMMEDIATE 'CALL ttConfiguration' > BULK COLLECT into v_ttConfigs;
> DBMS_OUTPUT.PUT_LINE ('Name: ' || v_ttConfigs(1).name > || ' Value: ' || v_ttConfigs(1).value);
> end; > /
Name: CacheGridEnable Value: 0
PL/SQL procedure successfully completed.
Note: String parameter values for built-in procedures must be single-quoted as indicated in these examples, unless the value is NULL.