Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  ABAP and SAP HANA 

Setting Transaction Behavior for SAP HANA

HANA-specific SQL contains the following statements for setting transaction behavior:

  • SET TRANSACTION AUTOCOMMIT DDL
  • SET TRANSACTION ISOLATION LEVEL
  • SET TRANSACTION LOCK WAIT TIMEOUT
  • SET TRANSACTION READ ONLY|WRITE

These statements modify the transaction behavior of the current database connection. They cannot be used directly by AS ABAP when accessing the SAP Hana database using Native SQL (ADBC, EXEC SQL). This is because transaction behavior defined for the current database connection using these settings is persisted beyond its current database LUW. If the database connection is then reused in ABAP SQL, Native SQL, or AMDP (see Database Connections), unexpected or critical situations can arise. The following methods of the class CL_SQL_CONNECTION should be used instead:

  • AUTOCOMMIT_DDL for SET TRANSACTION AUTOCOMMIT DDL
  • SET_ISOLATION_LEVEL for SET TRANSACTION ISOLATION LEVEL
  • SET_LOCK_WAIT_TIMEOUT for SET TRANSACTION LOCK WAIT TIMEOUT
  • There is no current method available for SET TRANSACTION READ ONLY|WRITE

These methods are wrappers for the SQL statements. The HANA-specific part (Client Library) of the Native SQL interface registers any calls of these methods and resets the transaction behavior of the current database connection to the default behavior at the end of the current database LUW.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • In SQLScript (and hence also in the corresponding AMDP methods), the SQL SET TRANSACTION statements for setting transaction behavior are not allowed in the syntax.

  • Currently, there are no automatic resets of the transaction behavior after method calls on any other database platforms.