t8y2/dbx · error

IoTDB does not support transactions

Error message

IoTDB does not support transactions

What it means

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.

Source

Thrown at agents/drivers/iotdb/query.go:313

}

func (s *server) closeAllQuerySessions() error {
	var firstErr error
	for sessionID, state := range s.querySessions {
		if err := state.dataset.Close(); err != nil && firstErr == nil {
			firstErr = err
		}
		delete(s.querySessions, sessionID)
	}
	return firstErr
}

func (s *server) executeStatements(params map[string]json.RawMessage, transaction bool) (queryResult, error) {
	if transaction {
		// IoTDB executes statements independently and exposes no rollbackable
		// transaction boundary. Reject the RPC before obtaining a client so a
		// requested atomic batch can never leave partial writes behind.
		return queryResult{}, errors.New("IoTDB does not support transactions")
	}
	started := time.Now()
	statements := stringSliceParam(params, "statements")
	if len(statements) == 0 {
		return queryResult{}, errors.New("statements are required")
	}
	database := strings.TrimSpace(stringParam(params, "schema"))
	for _, statement := range statements {
		sql := trimStatementSQL(statement)
		if sql == "" {
			continue
		}
		if isQueryStatement(sql) {
			values, err := s.queryValues(sql, database, defaultMaxRows, 0)
			if err != nil {
				return queryResult{}, err
			}
			_ = values

View on GitHub (pinned to c0390bff16)

Solutions

  1. Set transaction=false (or omit the transaction flag) and execute statements as an independent batch
  2. Restructure the workload so atomicity is not required, or perform compensating writes on failure at the application level
  3. Move the workload to a driver/database that supports transactions if atomic batches are a hard requirement

Example fix

// before
result := executeStatements(map[string]json.RawMessage{"statements": stmts}, true) // rejects
// after
result := executeStatements(map[string]json.RawMessage{"statements": stmts}, false)
Defensive patterns

Strategy: validation

Validate before calling

if transaction { return errors.New("this driver does not support transactions; call without transaction=true") }

Try / catch

if err := runBatch(false); err != nil { /* handle batch failure, apply compensating writes */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/b5e24690c067e28f. Report an issue: GitHub.