OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.3.3

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.3.3
    iconOceanBase Database
    SQL - V 4.3.3
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Transaction isolation levels in MySQL mode

    Last Updated:2024-11-11 07:37:15  Updated
    share
    What is on this page
    Isolation levels supported in MySQL mode
    Isolation level behavior comparison
    Isolation level settings
    Limitations

    folded

    share

    Isolation levels supported in MySQL mode

    The MySQL mode of OceanBase Database supports the following isolation levels:

    • Read committed: A query executed by a transaction can read only the data committed before the query starts. This isolation level cannot prevent non-repeatable or phantom reads.

    • Repeatable read: The same data read at different times within a transaction is consistent.

    • Serializable: It is similar to the serializable isolation level in Oracle Database but is not strictly a serializable isolation level.

    By default, OceanBase Database uses the read committed isolation level.

    Isolation level behavior comparison

    MySQL Database supports four isolation levels: read uncommitted, read committed, repeatable read, and serializable. The MySQL mode of OceanBase Database shows some differences in behavior compared with the MySQL database across these four isolation levels.

    • Read uncommitted:

      MySQL Database supports the read uncommitted isolation level, while OceanBase Database does not.

    • Read committed:

      In the read committed isolation level, when determining if a row meets the update condition, MySQL Database uses semi-consistent reads. If a row has already been updated by a concurrent transaction, MySQL Database waits for the concurrent transaction to finish and then evaluates the need for an update based on the latest version. On the other hand, in OceanBase Database, regardless of whether concurrent transactions update, the determination of whether a row meets the update condition is always based on the version in the statement snapshot.

    • Repeatable read:

      In the repeatable read isolation level, when a write conflict occurs, in MySQL Database, the later transaction will wait for the earlier transaction to finish. If the earlier transaction rolls back, the later transaction will update directly on the original version. If the earlier transaction commits, the later transaction will update on the newly committed version. On the other hand, in OceanBase Database, when a write conflict occurs, the later transaction will wait for the earlier transaction to finish. If the earlier transaction rolls back, the later transaction will update directly on the original version. However, if the earlier transaction commits, the later transaction will roll back and return an error.

    • Serializable:

      The serializable isolation level in MySQL Database uses two-phase locking (2PL), which can ensure strict serializability. On the other hand, the serializable isolation level in OceanBase Database uses snapshot isolation, which cannot guarantee strict serializability.

    Isolation level settings

    There are two ways to set the isolation level, namely the global level and the session level.

    SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL [READ COMMITTED | REPEATABLE READ | SERIALIZABLE];
    

    Limitations

    • The isolation level cannot be set during transaction execution, otherwise the following error will occur:

      ERROR 1568 (25001): Transaction characteristics can't be changed while a transaction is in progress
      
    • The isolation level set at the global level can be overridden by the isolation level at the session level.

    Previous topic

    Transaction isolation levels in Oracle mode
    Last

    Next topic

    Weak-consistency read
    Next
    What is on this page
    Isolation levels supported in MySQL mode
    Isolation level behavior comparison
    Isolation level settings
    Limitations