{"record":{"id":"b5e24690c067e28f","repo":"t8y2/dbx","slug":"iotdb-does-not-support-transactions","errorCode":null,"errorMessage":"IoTDB does not support transactions","messagePattern":"IoTDB does not support transactions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/iotdb/query.go","lineNumber":313,"sourceCode":"}\n\nfunc (s *server) closeAllQuerySessions() error {\n\tvar firstErr error\n\tfor sessionID, state := range s.querySessions {\n\t\tif err := state.dataset.Close(); err != nil && firstErr == nil {\n\t\t\tfirstErr = err\n\t\t}\n\t\tdelete(s.querySessions, sessionID)\n\t}\n\treturn firstErr\n}\n\nfunc (s *server) executeStatements(params map[string]json.RawMessage, transaction bool) (queryResult, error) {\n\tif transaction {\n\t\t// IoTDB executes statements independently and exposes no rollbackable\n\t\t// transaction boundary. Reject the RPC before obtaining a client so a\n\t\t// requested atomic batch can never leave partial writes behind.\n\t\treturn queryResult{}, errors.New(\"IoTDB does not support transactions\")\n\t}\n\tstarted := time.Now()\n\tstatements := stringSliceParam(params, \"statements\")\n\tif len(statements) == 0 {\n\t\treturn queryResult{}, errors.New(\"statements are required\")\n\t}\n\tdatabase := strings.TrimSpace(stringParam(params, \"schema\"))\n\tfor _, statement := range statements {\n\t\tsql := trimStatementSQL(statement)\n\t\tif sql == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif isQueryStatement(sql) {\n\t\t\tvalues, err := s.queryValues(sql, database, defaultMaxRows, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn queryResult{}, err\n\t\t\t}\n\t\t\t_ = values","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/iotdb/query.go#L295-L331","documentation":"IoTDB executes statements independently and exposes no rollbackable transaction boundary, so this driver rejects any RPC that requests a transactional batch. The check runs before a client is obtained, guaranteeing that a requested atomic batch can never leave partial writes behind. This is an intentional capability limitation, not a transient fault.","triggerScenarios":"Calling the statement-execution RPC (executeStatements) with transaction=true, e.g. issuing a multi-statement atomic batch or transaction-style workload against the IoTDB driver.","commonSituations":"Porting application code that wraps multiple writes in BEGIN/COMMIT from a transactional database to IoTDB; an ORM or connection pool configured to use implicit transactions; a generic driver layer that always sends transaction=true for batched writes.","solutions":["Set transaction=false (or omit the transaction flag) and execute statements as an independent batch","Restructure the workload so atomicity is not required, or perform compensating writes on failure at the application level","Move the workload to a driver/database that supports transactions if atomic batches are a hard requirement"],"exampleFix":"// before\nresult := executeStatements(map[string]json.RawMessage{\"statements\": stmts}, true) // rejects\n// after\nresult := executeStatements(map[string]json.RawMessage{\"statements\": stmts}, false)","handlingStrategy":"validation","validationCode":"if transaction { return errors.New(\"this driver does not support transactions; call without transaction=true\") }","typeGuard":null,"tryCatchPattern":"if err := runBatch(false); err != nil { /* handle batch failure, apply compensating writes */ }","preventionTips":["Never request transactional semantics from the IoTDB driver","Design writes to be idempotent so partial-batch failures can be retried","Centralize batch execution behind a helper that always passes transaction=false"],"tags":["iotdb","transactions","unsupported-feature"],"backgroundTag":"transactions-not-supported","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}