This topic describes the transaction specifications of OceanBase AI Database.
When operating on data in batches, the application must be capable of interrupt handling and have a retry mechanism for failed transactions.
Since OceanBase's distributed transactions use the two-phase commit protocol, the system must have mechanisms for transaction failure retry and checking the execution status of unresolved transaction states.
In the frontend program, use of set statements other than
set namesis prohibited, including similar commands such asset timezone,set SQL_mode, andset isolation_level.Sequences are useful when a unique primary key is required, as they provide globally unique and consecutive integers.
Limit the concurrency of sessions.
If a tenant has n CPUs, it typically supports at most
10*nactive user sessions. Any additional concurrent session requests will wait for an available worker thread before becoming active.Enable automatic transaction commit. It is not recommended to execute
set @@autocommit=xx; instead, use theConnection.setAutoCommit(xx)method.Start a transaction. We recommend that you use the
Connection.setAutoCommit(xx)method instead of executing thestart transaction/beginstatement.Commit transactions. We recommend that you use the
Connection.commit()andConnection.rollback()methods instead of executingcommit/rollback.