{"record":{"id":"a8abea681356c6c9","repo":"apache/seatunnel","slug":"date-base-error","errorCode":"DATE_BASE_ERROR","errorMessage":"${e.getMessage()}","messagePattern":"\\$\\{e\\.getMessage\\(\\)\\}","errorType":"error_code","errorClass":"Neo4jConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-neo4j/src/main/java/org/apache/seatunnel/connectors/seatunnel/neo4j/sink/Neo4jSinkWriter.java","lineNumber":130,"sourceCode":"        } catch (ClientException e) {\n            log.error(\"Failed to build cypher statement\", e);\n            throw new Neo4jConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    String.format(\n                            \"PluginName: %s, PluginType: %s, Message: %s\",\n                            PLUGIN_NAME, PluginType.SINK, e.getMessage()));\n        }\n    }\n\n    private void writeByQuery(Query query) {\n        try {\n            session.writeTransaction(\n                    tx -> {\n                        tx.run(query);\n                        return null;\n                    });\n        } catch (Neo4jException e) {\n            throw new Neo4jConnectorException(\n                    Neo4jConnectorErrorCode.DATE_BASE_ERROR, e.getMessage());\n        }\n    }\n\n    @Override\n    public Optional<Void> prepareCommit() throws IOException {\n        return Optional.empty();\n    }\n\n    @Override\n    public void abortPrepare() {}\n\n    @Override\n    public void close() throws IOException {\n        // writeByQuery rethrows as Neo4jConnectorException, so a failing final flush must not be\n        // allowed to skip the session and the driver, or the driver's connection pool and event\n        // loop are leaked for the lifetime of the task. Every step runs, and the first failure is\n        // the one that propagates: later ones are attached to it as suppressed.","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-neo4j/src/main/java/org/apache/seatunnel/connectors/seatunnel/neo4j/sink/Neo4jSinkWriter.java#L112-L148","documentation":"writeByQuery() runs the query inside a Neo4j write transaction; when the server responds with an org.neo4j.driver.exceptions.Neo4jException (execution error such as syntax error, constraint violation, or connectivity failure surfaced by the driver), it is rethrown as Neo4jConnectorException with DATE_BASE_ERROR and the server's message. This wraps any database-side rejection of the Cypher statement.","triggerScenarios":"Executing Cypher against a Neo4j instance that returns Neo4jException: invalid Cypher syntax, missing label/property references, constraint violations (unique constraints), database unavailable, or transaction termination.","commonSituations":"Typo in the query configured in the sink; writing duplicates that violate a unique constraint; Neo4j restart/timeout during a long batch; wrong database name in the URI.","solutions":["Read the wrapped e.getMessage() for the Neo4j server error code and fix the query accordingly","Validate Cypher syntax in Neo4j Browser with sample batch data","Handle constraint violations by deduplicating data or using MERGE instead of CREATE","Check Neo4j availability/connectivity settings if the error is transient, and rely on SeaTunnel retry/restore"],"exampleFix":"// before\nquery = \"CREATE (n:Person {id: $id})\" // fails on duplicate id constraint\n// after\nquery = \"MERGE (n:Person {id: $id})\"","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { sink.write(row); } catch (Neo4jConnectorException e) { /* DATE_BASE_ERROR: inspect message for Neo4j status code */ if (isTransient(e.getMessage())) retry(); else throw e; }","preventionTips":["Validate Cypher syntax before production","Use MERGE for idempotent writes against unique constraints","Monitor Neo4j availability and tune connection settings"],"tags":["java","neo4j","cypher","database"],"backgroundTag":"database-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}