问题背景:
1.database is neo4j 2.3.1, driver using jdbc;
2.db connection initialized as a class member, default is auto-commit(not changed);
为了避免插入重复项,我在插入之前进行查询。程序停止后,发现重复。为什么呢?
代码:
String query = "CREATE (n:LABEL {name:'jack'})";
System.out.println(query);
Statement stmt = dbConnection.createStatement();
stmt.executeUpdate(query);
stmt.close();
答案 0 :(得分:0)
答案 1 :(得分:0)