3.3.6 SQL and Global Transactions

Adhere to the following guidelines when using SQL and Global Transactions:

  • Care should be taken when executing SQL statements outside the scope of a global transaction. The SQL standard specifies that a local transaction should be started implicitly by the database resource manager whenever an SQL statement that needs the context of a transaction is executed and no transaction is active. The standard also says that a transaction that is implicitly started by the database resource manager must then be explicitly terminated by executing a COMMIT or ROLLBACK SQL statement; the TP Framework is not responsible for terminating transactions that are started by the resource manager.

    Note:

    This is not an issue when an application uses the XA library to connect to the Oracle server because those applications can operate only on global transactions. The Oracle server does not allow local transactions when it is using XA.
  • The SQL COMMIT and ROLLBACK statements cannot be used to terminate a global transaction that has been either started explicitly using Current.begin() or started implicitly by the system. Check the database vendor documentation for each database product for other possible restrictions when using global transactions.
  • SQL cursors may be closed when transactions are terminated. Consult your database product documentation for exact information about cursor handling rules. Application programmers should be careful to use cursors only with CORBA objects with appropriate activation policies and within appropriate transaction boundaries.