Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - SQL Usage » Transactions and isolation levels



SQL Anywhere expects you to group your statements into transactions. You commit a transaction to make changes to your database permanent. When you alter data, your alterations are recorded in the transaction log and are not made permanent until you enter the COMMIT statement.

Transactions start with one of the following events:

  • The first statement following a connection to a database.

  • The first statement following the end of a transaction.

Transactions complete with one of the following events:

  • A COMMIT statement makes the changes to the database permanent.

  • A ROLLBACK statement undoes all the changes made by the transaction.

  • A statement with a side effect of an automatic commit is executed: most data definition statements, such as ALTER, CREATE, COMMENT, and DROP have the side effect of an automatic commit.

  • A disconnection from a database performs an implicit rollback.

  • ODBC and JDBC have an autocommit setting that enforces a COMMIT after each statement. By default, ODBC and JDBC require autocommit to be on, and each statement is a single transaction. To take advantage of transaction design possibilities, you should turn autocommit off.

  • Setting the chained database option to Off is similar to enforcing an autocommit after each statement. By default, connections that use jConnect or Open Client applications have chained set to Off.

You can determine which connections have outstanding transactions by connecting to a database using the SQL Anywhere Console utility (dbconsole). Inspect the Connections pane to see which connection has uncommitted operations.

 Options in Interactive SQL
 Determining when a transaction began
 See also