{"record":{"id":"3d6fca3357c53793","repo":"greenrobot/greenDAO","slug":"unsupported-operation-operation-type","errorCode":null,"errorMessage":"Unsupported operation: ${operation.type}","messagePattern":"Unsupported operation: (.+?)","errorType":"exception","errorClass":"DaoException","httpStatus":null,"severity":"error","filePath":"DaoCore/src/main/java/org/greenrobot/greendao/async/AsyncOperationExecutor.java","lineNumber":335,"sourceCode":"                    operation.dao.deleteByKey(operation.parameter);\n                    break;\n                case DeleteAll:\n                    operation.dao.deleteAll();\n                    break;\n                case Load:\n                    operation.result = operation.dao.load(operation.parameter);\n                    break;\n                case LoadAll:\n                    operation.result = operation.dao.loadAll();\n                    break;\n                case Count:\n                    operation.result = operation.dao.count();\n                    break;\n                case Refresh:\n                    operation.dao.refresh(operation.parameter);\n                    break;\n                default:\n                    throw new DaoException(\"Unsupported operation: \" + operation.type);\n            }\n        } catch (Throwable th) {\n            operation.throwable = th;\n        }\n        operation.timeCompleted = System.currentTimeMillis();\n        // Do not set it to completed here because it might be a merged TX\n    }\n\n    private void executeTransactionRunnable(AsyncOperation operation) {\n        Database db = operation.getDatabase();\n        db.beginTransaction();\n        try {\n            ((Runnable) operation.parameter).run();\n            db.setTransactionSuccessful();\n        } finally {\n            db.endTransaction();\n        }\n    }","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/greenrobot/greenDAO/blob/0bbb338e17c4cf28aba5aae62d42f73f50186157/DaoCore/src/main/java/org/greenrobot/greendao/async/AsyncOperationExecutor.java#L317-L353","documentation":"executeOperation switches over AsyncOperation.Type to dispatch to the right DAO/session method. The default branch throws DaoException when the operation's type has no handler — i.e. an unknown or unsupported operation type reached the executor, typically from an older/newer greendao mismatch or custom code crafting operations.","triggerScenarios":"An AsyncOperation whose type is not one of the handled cases (e.g. a type added in a newer greendao release executed by an older core, or custom AsyncOperation construction with an unhandled type).","commonSituations":"Mixed greendao/greendao-api versions on the classpath (duplicate jars), shading/repackaging that splits classes, or framework code generating operation types this build's executor doesn't know.","solutions":["Verify all greendao artifacts come from a single consistent version; remove duplicate/stale DaoCore jars from the classpath.","Log operation.type to identify which operation kind is unsupported, and upgrade greendao to a version that handles it.","Avoid constructing AsyncOperation instances manually with arbitrary types; use the AsyncSession API methods.","After an AsyncSession.clear() or upgrade, clean/rebuild the project to avoid stale compiled classes."],"exampleFix":"// build.gradle: before\ndef versions = [greendao: '3.2.2', greendaoApi: '3.1.0'] // mismatched\n// after\ndef versions = [greendao: '3.3.0', greendaoApi: '3.3.0'] // aligned","handlingStrategy":"validation","validationCode":"// ensure a single greendao version on the classpath\nSet<String> versions = classpathArtifactsMatching(\"org.greenrobot:greendao\");\nif (versions.size() != 1) throw new IllegalStateException(\"mixed greendao versions: \" + versions);","typeGuard":null,"tryCatchPattern":"try {\n    asyncSession.insert(entity);\n} catch (DaoException e) {\n    if (e.getMessage().startsWith(\"Unsupported operation:\")) {\n        log.severe(\"greendao version mismatch or unhandled op type\");\n    }\n}","preventionTips":["Pin all org.greenrobot artifacts to the same version in Gradle","Never construct AsyncOperation objects manually with raw types; use AsyncSession methods","Clean rebuild after upgrading greendao to avoid stale classes"],"tags":["async","version-mismatch","greendao"],"backgroundTag":"unsupported-operation","analyzedSha":"0bbb338e17c4cf28aba5aae62d42f73f50186157","analyzedAt":"2026-09-08T03:22:36.050Z","contentChangedAt":"2026-09-08T03:22:36.050Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}