java.sql.SQLException: Neo.ClientError.Statement.SyntaxError: Invalid input '。': expected whitespace or a property key name (line 1, column 48 (offset: 47))
"CREATE(n:TEST{Name:'TEST'}) SET n.p1 = 'A1', n.。p2 = 'A2';"
^
at org.neo4j.jdbc.bolt.BoltStatement.wrapException(BoltStatement.java:91)
at org.neo4j.jdbc.bolt.BoltStatement.executeUpdate(BoltStatement.java:103)
at org.neo4j.jdbc.bolt.BoltStatement.execute(BoltStatement.java:112)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at com.emotibot.kgoff.mappers.UpdateNeo4jMapper.main(UpdateNeo4jMapper.java:242)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: org.neo4j.driver.v1.exceptions.ClientException: Invalid input '。': expected whitespace or a property key name (line 1, column 48 (offset: 47))
"CREATE(n:TEST{Name:'TEST'}) SET n.p1 = 'A1', n.。p2 = 'A2';"
^
at org.neo4j.driver.internal.connector.socket.SocketResponseHandler.handleFailureMessage(SocketResponseHandler.java:68)
at org.neo4j.driver.internal.messaging.PackStreamMessageFormatV1$Reader.unpackFailureMessage(PackStreamMessageFormatV1.java:464)
at org.neo4j.driver.internal.messaging.PackStreamMessageFormatV1$Reader.read(PackStreamMessageFormatV1.java:425)
at org.neo4j.driver.internal.connector.socket.SocketClient.receiveOne(SocketClient.java:130)
at org.neo4j.driver.internal.connector.socket.SocketClient.receiveAll(SocketClient.java:124)
at org.neo4j.driver.internal.connector.socket.SocketConnection.receiveAll(SocketConnection.java:129)
at org.neo4j.driver.internal.connector.socket.SocketConnection.sync(SocketConnection.java:108)
at org.neo4j.driver.internal.connector.ConcurrencyGuardingConnection.sync(ConcurrencyGuardingConnection.java:136)
at org.neo4j.driver.internal.pool.PooledConnection.sync(PooledConnection.java:157)
at org.neo4j.driver.internal.InternalTransaction.close(InternalTransaction.java:110)
at org.neo4j.jdbc.bolt.BoltStatement.executeInternal(BoltStatement.java:68)
at org.neo4j.jdbc.bolt.BoltStatement.executeUpdate(BoltStatement.java:96)
... 9 more
java.sql.SQLException: Neo.ClientError.Request.Invalid: 'beginning implicit transaction' cannot be done when a session is in the 'IN_TRANSACTION' state.
at org.neo4j.jdbc.bolt.BoltStatement.wrapException(BoltStatement.java:91)
at org.neo4j.jdbc.bolt.BoltStatement.executeUpdate(BoltStatement.java:103)
at org.neo4j.jdbc.bolt.BoltStatement.execute(BoltStatement.java:112)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at com.emotibot.kgoff.mappers.UpdateNeo4jMapper.main(UpdateNeo4jMapper.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: org.neo4j.driver.v1.exceptions.ClientException: 'beginning implicit transaction' cannot be done when a session is in the 'IN_TRANSACTION' state.
at org.neo4j.driver.internal.connector.socket.SocketResponseHandler.handleFailureMessage(SocketResponseHandler.java:68)
at org.neo4j.driver.internal.messaging.PackStreamMessageFormatV1$Reader.unpackFailureMessage(PackStreamMessageFormatV1.java:464)
at org.neo4j.driver.internal.messaging.PackStreamMessageFormatV1$Reader.read(PackStreamMessageFormatV1.java:425)
at org.neo4j.driver.internal.connector.socket.SocketClient.receiveOne(SocketClient.java:130)
at org.neo4j.driver.internal.connector.socket.SocketClient.receiveAll(SocketClient.java:124)
at org.neo4j.driver.internal.connector.socket.SocketConnection.receiveAll(SocketConnection.java:129)
at org.neo4j.driver.internal.connector.socket.SocketConnection.sync(SocketConnection.java:108)
at org.neo4j.driver.internal.connector.ConcurrencyGuardingConnection.sync(ConcurrencyGuardingConnection.java:136)
at org.neo4j.driver.internal.pool.PooledConnection.sync(PooledConnection.java:157)
at org.neo4j.driver.internal.InternalTransaction.close(InternalTransaction.java:110)
at org.neo4j.jdbc.bolt.BoltStatement.executeInternal(BoltStatement.java:68)
at org.neo4j.jdbc.bolt.BoltStatement.executeUpdate(BoltStatement.java:96)
... 9 more
my test code is:
1. The first cypher, I add a '。' for p2 property deliberately.
2. The second cypher i delete the '。' character, i want reuse this connection, but i got a exception too.
3. I debug this exception, found that this error is neo4j server response.
4. I use neo4j jdbc 3.0.1.
Connection conn = null;
try {
conn = ds.getConnection();
boolean ret = conn.createStatement().execute("CREATE(n:TEST{Name:'TEST'}) SET n.p1 = 'A1', n.。p2 = 'A2';");
System.out.println("execute ret:" + ret);
} catch (SQLException e) {
e.printStackTrace();
try {
if (conn != null) {
boolean ret = conn.createStatement().execute("CREATE(n:TEST{Name:'TEST'}) SET n.p1 = 'A1', n.p2 = 'A2';");
System.out.println("retry execute ret:" + ret);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
在 2016年8月4日星期四 UTC+8下午2:21:56,Matias Burak写道: