[ python-oracledb ](../index.html)

latest

  * [ 1\. Introduction to the Python Driver for Oracle Database ](introduction.html)
  * [ 2\. Installing python-oracledb ](installation.html)
  * [ 3\. Initializing python-oracledb ](initialization.html)
  * [ 4\. Connecting to Oracle Database ](connection_handling.html)
  * [ 5\. Executing SQL ](sql_execution.html)
  * [ 6\. Executing PL/SQL ](plsql_execution.html)
  * [ 7\. Using Bind Variables ](bind.html)
  * [ 8\. Executing Batch Statements and Bulk Loading ](batch_statement.html)
  * 9\. Managing Transactions 
    * 9.1. Autocommitting 
    * 9.2. Explicit Transactions 
  * [ 10\. Tuning python-oracledb ](tuning.html)
  * [ 11\. Using CLOB and BLOB Data ](lob_data.html)
  * [ 12\. Using JSON Data ](json_data_type.html)
  * [ 13\. Using XMLTYPE Data ](xml_data_type.html)
  * [ 14\. Working with Simple Oracle Document Access (SODA) ](soda.html)
  * [ 15\. Using Oracle Advanced Queuing (AQ) ](aq.html)
  * [ 16\. Working with Continuous Query Notification (CQN) ](cqn.html)
  * [ 17\. Using Two-Phase Commits (TPC) ](two_phase_commit.html)
  * [ 18\. Starting and Stopping Oracle Database ](startup.html)
  * [ 19\. Using High Availability with python-oracledb ](ha.html)
  * [ 20\. Character Sets and Globalization ](globalization.html)
  * [ 21\. Concurrent Programming with asyncio ](asyncio.html)
  * [ 22\. Catching Exceptions ](exception_handling.html)
  * [ 23\. Tracing python-oracledb ](tracing.html)
  * [ 24\. Troubleshooting Errors ](troubleshooting.html)
  * [ 25\. Appendix A: Oracle Database Features Supported by python-oracledb ](appendix_a.html)
  * [ 26\. Appendix B: Differences between python-oracledb Thin and Thick Modes ](appendix_b.html)
  * [ 27\. Appendix C: The python-oracledb and cx_Oracle Drivers ](appendix_c.html)

  * [ 1\. API: python-oracledb Module ](../api_manual/module.html)
  * [ 2\. API: Defaults Object ](../api_manual/defaults.html)
  * [ 3\. API: Connection Objects ](../api_manual/connection.html)
  * [ 4\. API: ConnectParams Objects ](../api_manual/connect_params.html)
  * [ 5\. API: ConnectionPool Objects ](../api_manual/connection_pool.html)
  * [ 6\. API: PoolParams Objects ](../api_manual/pool_params.html)
  * [ 7\. API: Cursor Objects ](../api_manual/cursor.html)
  * [ 8\. API: FetchInfo Objects ](../api_manual/fetch_info.html)
  * [ 9\. API: Variable Objects ](../api_manual/variable.html)
  * [ 10\. API: Subscription Objects ](../api_manual/subscription.html)
  * [ 11\. API: LOB Objects ](../api_manual/lob.html)
  * [ 12\. API: DbObjectType Objects ](../api_manual/dbobject_type.html)
  * [ 13\. API: Advanced Queuing (AQ) ](../api_manual/aq.html)
  * [ 14\. API: SODA ](../api_manual/soda.html)
  * [ 15\. API: AsyncConnection Objects ](../api_manual/async_connection.html)
  * [ 16\. API: AsyncConnectionPool Objects ](../api_manual/async_connection_pool.html)
  * [ 17\. API: AsyncCursor Objects ](../api_manual/async_cursor.html)
  * [ 18\. API: AsyncLOB Objects ](../api_manual/async_lob.html)
  * [ 19\. Deprecated and Desupported Features ](../api_manual/deprecations.html)

  * [ python-oracledb Release Notes ](../release_notes.html)
  * [ License ](../license.html)

__ [ python-oracledb ](../index.html)

  * [ ](../index.html)
  * 9\.  Managing Transactions 
  * [ Edit on GitHub ](https://github.com/oracle/python-oracledb/blob/main/doc/src/user_guide/txn_management.rst)

* * *

#  9\.  Managing Transactions  

A database transaction is a grouping of SQL statements that make a logical
data change to the database.

When [ ` Cursor.execute()  ` ](../api_manual/cursor.html#Cursor.execute
"Cursor.execute") or [ ` Cursor.executemany()  `
](../api_manual/cursor.html#Cursor.executemany "Cursor.executemany") executes
a SQL statement, a transaction is started or continued. By default, python-
oracledb does not commit this transaction to the database. The methods [ `
Connection.commit()  ` ](../api_manual/connection.html#Connection.commit
"Connection.commit")