JDBC/MX 5.0 Driver for SQL/MX Programmer's Reference (SQL/MX 2.x)
The JDBC/MX driver provides transaction support to maintain data integrity and consistency. To allow the application
to interleave transactions between SQL/MX objects and the traditional file system, the JDBC/MX driver checks if a
transaction is active whenever it needs to interact with SQL/MX.
The transactionMode property determines transaction processing behavior. If you use transactionMode in a typical
environment, with the default value mixed,
When an active transaction exists, the autocommit setting is ignored, and the JDBC/MX driver lets the
application manage the transaction.
When no active transaction exists, the JDBC/MX driver manages the transactions.
This implementation differs from JDBC/MP. In the JDBC/MP driver, two different types of URLs decide which
component manages the transaction.
If you are accessing BLOB and CLOB data, see also Transactions Involving Blob and Clob Access.
Autocommit Mode and Transaction Boundaries
When JDBC/MX manages the transactions, the driver decides to start a new transaction. A new transaction is started
when no transaction is associated with the Connection. When there is a transaction associated with the Connection,
that transaction is resumed. The Connection attribute autocommit specifies when to end the transaction. Enabling
autocommit causes the JDBC/MX driver to end the transaction in accordance with the following rules:
The JDBC/MX driver rolls back the transaction for any SQL error in SQL statements other than SELECT
statements.
In the case of non-SELECT SQL statements, the JDBC/MX driver commits the transaction if the current
transaction was started for this SQL statement.
In the case of SELECT statements, the JDBC/MX driver commits the transaction at the time of closing the result
set.
In the case of concurrent multiple SELECT statements, the JDBC/MX driver commits the transaction only when
the result set of the SELECT statement or the statement that started the transaction is closed.
Disabling Autocommit Mode
When the autocommit mode is disabled, the application must explicitly commit or roll back each transaction by calling
the Connection methods commit and rollback, respectively. When any SQL error occurs in SQL statements other
than SELECT statement, SQL/MX flags the transactions for aborting. In such a case, the transaction is rolled back
without regard to whether the application commits or rolls back the transaction.
Stored Procedures
SQL/MX provides support for stored procedures with result sets, which are written in Java and run under an SQL/MX
execution environment.
Stored procedures can be run in SQL/MX by using the CALL statement. The JDBC/MX driver allows stored
procedures to be called by using the standard JDBC API escape syntax for stored procedures. The escape SQL syntax
is:










