Transactions

Use transactions when executing multiple insertion, deletion, or update operations to enhance performance. Call SQLSetConnectOption on the connection handle (hdbc) with SQL_AUTOCOMMIT set to SQL_AUTOCOMMIT_OFF to turn auto-commit mode off. When the driver uses auto-commit mode and SQL statements, it must make sure that each individual INSERT, DELETE, or UPDATE statement is flushed to the safe store (usually to disk). If the statements are grouped in a transaction, the driver can delay the writes to disk, and then perform only one write during commit time. Because disk I/O takes a relatively long time, turning auto-commit mode off enhances performance.