{"record":{"id":"90b85e0739831960","repo":"chroma-core/chroma","slug":"txn-commit-cannot-be-called-inside-run","errorCode":null,"errorMessage":"txn.commit() cannot be called inside run()","messagePattern":"txn\\.commit\\(\\) cannot be called inside run\\(\\)","errorType":"validation","errorClass":"ChromaValueError","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/collection.ts","lineNumber":1462,"sourceCode":"      uris: preparedRecordSet.uris,\n    });\n  }\n\n  public async delete({ ids }: { ids: string[] }): Promise<void> {\n    this.ensureOpen();\n    validateIDs(ids);\n\n    this.bufferWrite(\"delete\", ids, {\n      ids,\n      where: null,\n      where_document: null,\n      limit: null,\n    });\n  }\n\n  public async commit(): Promise<ConditionalCommitResult> {\n    if (this.commitBlockedByRun) {\n      throw new ChromaValueError(\"txn.commit() cannot be called inside run()\");\n    }\n    return this.commitAfterRun();\n  }\n\n  public async run<T>(\n    callback: (transaction: ConditionalCollectionTransaction) => T | Promise<T>,\n    options?: ConditionalTransactionRunOptions | number,\n  ): Promise<T> {\n    const maxRetries = conditionalMaxRetries(options);\n\n    let attempt = 0;\n    while (true) {\n      const transaction = this.newAttempt(attempt);\n      transaction.commitBlockedByRun = true;\n\n      let value: T;\n      try {\n        value = await callback(transaction);","sourceCodeStart":1444,"sourceCodeEnd":1480,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/collection.ts#L1444-L1480","documentation":"Error \"txn.commit() cannot be called inside run()\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/chromadb/src/collection.ts:1462 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}