Commit cb037974 by qiuchaofei

删除neo4j的数据,添加try, catch。

parent b30ae33b
......@@ -2552,16 +2552,21 @@ public class MetadataServiceImpl implements IMetadataService {
@Override
public void deleteNodeByCatalogName(String catalogName) {
try{
Neo4jConfig neo4jConfig = new Neo4jConfig();
Driver neo4jConnection = neo4jConfig.getNeo4jConnection();
Session session = neo4jConnection.session();
String cypher = "match (n) where n.metadataId =~'.*="+catalogName+"=.*' detach delete n";
logger.info("删除数据的语句:"+cypher);
StatementResult statementResult = session.run(cypher);
while (statementResult.hasNext()){
logger.info("statementResult.next():"+statementResult.next());
}
}catch(Exception e){
logger.info("删除数据异常:"+e.getMessage());
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment