ThreadSafe

Description

Specifies whether your connection should take advantage of the database server threadsafe client libraries.

By default, ThreadSafe is set to No to specify that your connection does not use the threadsafe client libraries. If you set ThreadSafe to Yes, your connection takes advantage of the threadsafe client libraries.

When to specify ThreadSafe

You must specify a value for ThreadSafe before connecting to the database.

Applies to

INF Informix

IN9 Informix

O90 Oracle9i

O10 Oracle 10g

ORA Oracle (for 11g and later)

Syntax

ThreadSafe='value'

Parameter

Description

value

Specifies whether a connection uses the database server threadsafe client libraries. Values are:

  • Yes

    Your connection uses the threadsafe client libraries. Use this setting when building distributed applications that require a multi-threaded environment.

  • No

    (Default) Your connection does not use the threadsafe client libraries. Use this setting when building nondistributed applications that require a single-threaded environment.


Default value

ThreadSafe='No'

Usage

When to use

Oracle and Informix provide support for thread safety in their client libraries. When you are using the Oracle or Informix database interface to build multi-threaded applications in PowerBuilder, set the ThreadSafe parameter to Yes to use threadsafe client libraries. This prevents possible side effects among multiple threads of execution making calls to the database server. Your application might incur a performance penalty when you use the threadsafe client libraries.

By default, the client software (and, thus, PowerBuilder) assumes that you are building an application in a single-threaded environment that does not need the threadsafe client libraries. This default ensures that single-threaded applications do not incur the performance penalty associated with using threadsafe libraries. Therefore, if you are building single-threaded applications, you can leave the ThreadSafe parameter set to No (the default).

This parameter cannot be set dynamically. The value set when the connection is made remains in effect until it is disconnected.

Examples

To specify that your connection uses the threadsafe client libraries:

  • Database profile

    Select the Thread Safe check box on the Connection page in the Database Profile Setup dialog box.

  • Application

    Type the following in code:

    SQLCA.DBParm="ThreadSafe='Yes'"