{"record":{"id":"f2119e2d3d1eb6b6","repo":"t8y2/dbx","slug":"no-manual-transaction-open","errorCode":null,"errorMessage":"no manual transaction open","messagePattern":"no manual transaction open","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/oracle-go/main.go","lineNumber":1213,"sourceCode":"\tif strings.TrimSpace(schema) != \"\" {\n\t\tif _, err := conn.ExecContext(context.Background(), \"ALTER SESSION SET CURRENT_SCHEMA = \"+quoteIdentifier(schema)); err != nil {\n\t\t\t_ = conn.Close()\n\t\t\treturn err\n\t\t}\n\t}\n\ttx, err := conn.BeginTx(context.Background(), nil)\n\tif err != nil {\n\t\t_ = conn.Close()\n\t\treturn fmt.Errorf(\"begin manual transaction: %w\", err)\n\t}\n\ts.manualConn = conn\n\ts.manualTx = tx\n\treturn nil\n}\n\nfunc (s *server) commitManualTransaction() error {\n\tif s.manualTx == nil {\n\t\treturn errors.New(\"no manual transaction open\")\n\t}\n\terr := s.manualTx.Commit()\n\ts.clearManualTransaction()\n\treturn err\n}\n\nfunc (s *server) rollbackManualTransaction() error {\n\tif s.manualTx == nil {\n\t\treturn errors.New(\"no manual transaction open\")\n\t}\n\terr := s.manualTx.Rollback()\n\ts.clearManualTransaction()\n\treturn err\n}\n\nfunc (s *server) rollbackManualTransactionQuiet() error {\n\tif s.manualTx == nil {\n\t\treturn nil","sourceCodeStart":1195,"sourceCodeEnd":1231,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/oracle-go/main.go#L1195-L1231","documentation":"This error is thrown by the Oracle driver agent's commitManualTransaction when the agent holds no open manual (session-scoped) transaction — i.e. s.manualTx is nil. The manual transaction is only present after a successful 'begin manual transaction' RPC that stores the *sql.Tx in s.manualTx. Committing without one is an invalid state transition, so the agent refuses instead of panicking on a nil pointer.","triggerScenarios":"Calling the commit-transaction RPC when no manual transaction was ever begun, after it was already committed (commit clears manualTx), after it was rolled back (rollback clears manualTx), or after the agent process restarted losing its in-memory transaction state.","commonSituations":"Client-side double-commit due to retries; a rollback in an error path followed by a commit attempt in a defer; driver/session state lost between agent restarts while the client still thinks a transaction is open.","solutions":["Ensure a 'begin manual transaction' RPC succeeded before calling commit","Remove duplicate commit calls (e.g. commit both in an error path and a defer); check hasManualTransaction first","If the transaction was rolled back, do not commit — start a new transaction instead","Verify the agent process was not restarted mid-transaction; re-begin the transaction if it was"],"exampleFix":"// before\nawait driver.commitTransaction();\nawait driver.commitTransaction(); // panics/errors: no manual transaction open\n// after\nif (await driver.hasManualTransaction()) {\n  await driver.commitTransaction();\n}","handlingStrategy":"try-catch","validationCode":"if (!driver.hasManualTransaction()) {\n  throw new Error('commitTransaction called without an open manual transaction')\n}","typeGuard":"function canCommit(d) {\n  return typeof d.hasManualTransaction === 'function' && d.hasManualTransaction()\n}","tryCatchPattern":"try {\n  await driver.commitTransaction()\n} catch (e) {\n  if (String(e.message).includes('no manual transaction open')) {\n    // already committed/rolled back — treat as idempotent no-op\n    return\n  }\n  throw e\n}","preventionTips":["Wrap begin/commit/rollback in a single client-side helper that tracks state","Never commit twice; use a once-style guard for cleanup paths","Log transaction lifecycle transitions to spot double-commit","Re-verify agent session state after any agent restart"],"tags":["oracle","transaction","state-error"],"backgroundTag":"no-transaction-open","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"}