Running Db2 for i CLI in server mode

The reason for running in SQL server mode is that many applications need to act as database servers. This means that a single job performs SQL requests on behalf of multiple users.

Without using SQL server mode, applications might encounter one or more of the following limitations:
  • A single job can have only one commit transaction per activation group.
  • A single job can be connected to a relational database (RDB) only once.
  • All SQL statements run under the user profile of the job, regardless of the user ID passed on the connection.

SQL server mode circumvents these limitations by routing all SQL statements to separate jobs. Each connection runs in its own job. The system uses prestart jobs named QSQSRVR in the QSYSWRK subsystem or a selected subsystem to minimize the startup time for each connection. Because each call to SQLConnect() can accept a different user profile, each job also has its own commit transaction. As soon as the SQLDisconnect() has been performed, the job is reset and put back in the pool of available jobs.