Firebird Documentation IndexFirebird ODBC/JDBC Driver ManualDeveloping with the Firebird ODBC/JDBC Driver → Multithreading
Firebird Home Firebird Home Prev: Developing with the Firebird ODBC/JDBC DriverFirebird Documentation IndexUp: Developing with the Firebird ODBC/JDBC DriverNext: Transactions

Multithreading

Thread protection can be specified at two levels:

  1. sharing an environment handle
  2. sharing a connection handle

By default, the driver is built using the following define:

#define DRIVER_LOCKED_LEVEL     DRIVER_LOCKED_LEVEL_CONNECT
      

which enables a single connection to share multiple local threads.

The default setting is reflected in the initial setup of the DSN on Windows: SAFETHREAD=Y.

If the driver is built using the following define:

#define DRIVER_LOCKED_LEVEL     DRIVER_LOCKED_LEVEL_NONE
      

then the driver is built without multi-threading support and responsibility for threading control is transferred to the Firebird client library. This provides for fastest performance.

If you have a build that was made with this define, you should make it the default thread behaviour for the DSN by configuring SAFETHREAD=N in its interface.

If the driver is built using the following define:

#define DRIVER_LOCKED_LEVEL     DRIVER_LOCKED_LEVEL_ENV
      

then a single environment handle can be shared by multiple local threads.

Note

You may save a specific set of connection conditions or overrides in a FILEDSN.

Prev: Developing with the Firebird ODBC/JDBC DriverFirebird Documentation IndexUp: Developing with the Firebird ODBC/JDBC DriverNext: Transactions
Firebird Documentation IndexFirebird ODBC/JDBC Driver ManualDeveloping with the Firebird ODBC/JDBC Driver → Multithreading