{"slug": "oceanbase-vsag-index-solving-mybatis-batch-insert-timeouts", "title": "OceanBase VSAG Index: Solving MyBatis Batch Insert Timeouts", "summary": "OceanBase 4.3.3's VSAG vector index causes transaction timeouts during MyBatis batch inserts of 1536-dimensional embedding vectors, with a batch size of 200 consistently failing even after increasing query and transaction timeouts to 120 seconds. Dropping the VSAG index allows the same 50,000-record payload to complete in seconds, indicating synchronous graph-based index maintenance is holding locks too long. The user seeks asynchronous or deferred index build options to decouple graph construction from transaction commits.", "body_md": "# OceanBase VSAG Index: Solving MyBatis Batch Insert Timeouts\n\n`saveBatch`\n\nwith a batch size of 200 is triggering consistent transaction timeouts in OceanBase 4.3.3 when writing 1536-dimensional embedding vectors. The failure is specific to tables where a VSAG vector index is active.The error is explicit:\n\n```\nJDBC SQLState: XA102, Error Code: 4012 - Transaction timeout or statement timeout exceeded\n```\n\nAfter running some tests, the bottleneck is definitely the index. If I drop the VSAG index, the same 50,000 record payload finishes in seconds. Even after cranking `ob_query_timeout`\n\nand `ob_trx_timeout`\n\nto 120s+, the batches still crash. It looks like the synchronous overhead of maintaining the graph-based index during the write is holding locks too long, causing a pile-up.\n\nI'm trying to figure out if there is a way to handle this via a more efficient AI workflow for data ingestion. Specifically, I need to know if OceanBase supports asynchronous VSAG index maintenance or a deferred build mode to prevent these synchronous blocks during high-throughput inserts.\n\nFor anyone else doing a deep dive into OceanBase vector deployment, here is my current setup:\n\n**Database:** OceanBase 4.3.3 (MySQL mode)**Table Config:** Hash partitioned**Index:** Native VSAG on`vector_data`\n\n(1536-dim)**Framework:** Spring Boot + MyBatis-Plus\n\nIf you've found a specific session variable to decouple the graph construction from the transaction commit, or a better batch tuning pattern for vector data, I'd appreciate the lead.\n\n[Next Competiflow: Automating Competitor Intelligence →](/en/threads/2384/)", "url": "https://wpnews.pro/news/oceanbase-vsag-index-solving-mybatis-batch-insert-timeouts", "canonical_source": "https://promptcube3.com/en/threads/2400/", "published_at": "2026-07-23 15:47:58+00:00", "updated_at": "2026-07-24 00:06:52.280362+00:00", "lang": "en", "topics": ["ai-infrastructure", "ai-tools"], "entities": ["OceanBase", "MyBatis", "Spring Boot", "MyBatis-Plus"], "alternates": {"html": "https://wpnews.pro/news/oceanbase-vsag-index-solving-mybatis-batch-insert-timeouts", "markdown": "https://wpnews.pro/news/oceanbase-vsag-index-solving-mybatis-batch-insert-timeouts.md", "text": "https://wpnews.pro/news/oceanbase-vsag-index-solving-mybatis-batch-insert-timeouts.txt", "jsonld": "https://wpnews.pro/news/oceanbase-vsag-index-solving-mybatis-batch-insert-timeouts.jsonld"}}