{"record":{"id":"3d37bd8e10e16616","repo":"hyperledger/fabric","slug":"txid-s-unsuppored-transaction-transaction-has","errorCode":null,"errorMessage":"txid [%s]: unsuppored transaction. Transaction has already performed queries on pvt data. Writes are not allowed","messagePattern":"txid \\[(.+?)\\]: unsuppored transaction\\. Transaction has already performed queries on pvt data\\. Writes are not allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/ledger/kvledger/txmgmt/txmgr/tx_simulator.go","lineNumber":245,"sourceCode":"\t}\n\tif err := s.checkPaginatedQueryPerformed(); err != nil {\n\t\treturn err\n\t}\n\ts.writePerformed = true\n\treturn s.queryExecutor.txmgr.db.ValidateKeyValue(key, value)\n}\n\nfunc (s *txSimulator) checkBeforePvtdataQueries() error {\n\tif s.writePerformed {\n\t\treturn errors.Errorf(\"txid [%s]: unsuppored transaction. Queries on pvt data is supported only in a read-only transaction\", s.txid)\n\t}\n\ts.pvtdataQueriesPerformed = true\n\treturn nil\n}\n\nfunc (s *txSimulator) checkPvtdataQueryPerformed() error {\n\tif s.pvtdataQueriesPerformed {\n\t\treturn errors.Errorf(\"txid [%s]: unsuppored transaction. Transaction has already performed queries on pvt data. Writes are not allowed\", s.txid)\n\t}\n\treturn nil\n}\n\nfunc (s *txSimulator) checkBeforePaginatedQueries() error {\n\tif s.writePerformed {\n\t\treturn errors.Errorf(\"txid [%s]: unsuppored transaction. Paginated queries are supported only in a read-only transaction\", s.txid)\n\t}\n\ts.paginatedQueriesPerformed = true\n\treturn nil\n}\n\nfunc (s *txSimulator) checkPaginatedQueryPerformed() error {\n\tif s.paginatedQueriesPerformed {\n\t\treturn errors.Errorf(\"txid [%s]: unsuppored transaction. Transaction has already performed a paginated query. Writes are not allowed\", s.txid)\n\t}\n\treturn nil\n}","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/ledger/kvledger/txmgmt/txmgr/tx_simulator.go#L227-L263","documentation":"checkPvtdataQueryPerformed detected that a private-data query already ran on this simulator, then a write was attempted. Writes after pvt reads are forbidden because the read set could not be validated against a stable private state.","triggerScenarios":"Thrown at core/ledger/kvledger/txmgmt/txmgr/tx_simulator.go:245 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the write to a separate transaction without pvt reads","Restructure chaincode logic to avoid read-pvt-then-write patterns"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}