Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

How to Enable/Disable AutoCommit Mode


One thing anyone would want from a database is to use Transactions. In order to do so, one must know that CUBRID has autocommit enabled by default. In order to be able to use Transactions, this will need to be disabled and there are several ways to do this:

  • CSQL Interpreter

In CSQL, the command ;autocommit or ;au for short:

;au off

Here is an example: http://www.cubrid.org/manual/90/en/Transaction Commit

  • CUBRID Manager

In CUBRID Manager, autocommit can be disabled by clicking the autocommit icon in the upper part of the query editor tab.

autocommit.png

  • Drivers

 In various drivers, there are functions for each driver that allow enabling/disabling the autocommit mode:

PHP - http://www.php.net/manual/en/function.cubrid-set-autocommit.php

Python - http://www.cubrid.org/wiki_apis/entry/cubrid-python-api-documentation (autocommit in url)

Ruby - http://www.cubrid.org/wiki_apis/entry/cubrid-ruby-api-documentation

JDBC - http://www.cubrid.org/accessing_cubrid_with_jdbc_part2 (setAutoCommit function)

CCI - http://www.cubrid.org/manual/90/en/cci_set_autocommit

ADO.NET - http://www.cubrid.org/wiki_apis/entry/connection-options

 

Regardless of the approach chosen, 2 SQL commands can be used to commit or rollback a transaction:

COMMIT

in order to commit a transaction and

ROLLBACK

in order to perform a rollback. You can also perform rollbacks to a savepoint. A tutorial with an example can be found here: http://www.cubrid.org/manual/90/en/Savepoint and Partial Rollback

comments powered by Disqus
Page info
viewed 1825 times
translations en
Author
posted last year by
CUBRID
Contributors
updated last year by
View revisions
Share this article