Transaction Support
An application determines whether transactions are supported, whether DDL can
be included in a transaction, and any special effects of including DDL in a
transaction, by calling SQLGetInfo with the SQL_TXN_CAPABLE option. For more information, see the SQLGetInfo function description.
If the driver does not support transactions, but the application has the
ability (using an API other than ODBC) to lock and unlock data, applications can
achieve transaction support by locking and unlocking records and tables as needed.
To implement the account-transfer example, the application would lock the
records for both accounts, copy the current values, debit the first account, credit
the second account, and unlock the records. If any steps failed, the
application would reset the accounts using the copies.
Even data sources that support transactions might not be able to support more
than one transaction at a time within a particular environment. Applications
call SQLGetInfo with the SQL_MULTIPLE_ACTIVE_TXN option to determine whether a data source
can support simultaneous active transactions on more than one connection in the
same environment. Because there is one transaction per connection, this is only
interesting to applications that have multiple connections to the same data
source.