β05-14-2022 02:23 PM
Running Neo4j Community Edition 4.4.6
on UBUNTU 22.04 under PARALLELS on a MACBOOK PRO with M1 processor
and on UBUNTU 20.04 X64 bare metal
Good morning
I moved on a brand new MacBook Pro with M1 processor, running Parallels, then I created an Ubuntu VM and installed Neo4j using apt install neo4j
. I also installed apoc
and cypher-shell
.
Everything seemed to run, but, when I ran my first query, it returned an error.
SELECT (n:Country)
CALL {
WITH n DETACH DELETE n
} IN TRANSACTIONS;
The first time I launched the query on an empty database, it ran.
The second time, when there was Country
nodes, it failed with the following message:
Neo.DatabaseError.Statement.ExecutionFailed: a query with `CALL { ... } IN TRANSACTIONS` can only be executed in an implicit transaction, but tried to execute in an explicit transaction.
The problem is that the same query run everyday without problems on my old bare metal Ubuntu 20.04 machine
Any suggestion will be appreciated.
I have also another problem with the apple m1 silicon
that I described in https://community.neo4j.com/t/neo4j-refuses-to-start-with-zulu-jvm/56213
where the neo4j manual gave wrong indications. Please, could someone check it too? Thank you in advance
Thank you!
β05-14-2022 03:49 PM
Are the versions on your new Mac and the bare metal the same. I recall this behavior was changed. Try inserting :auto
at the beginning of the query.
I guess you didnβt get an error when there was no data because the match return a null result and didnβt try to execute the call clause.
β05-14-2022 03:52 PM
Yes, it is exactly so: with no data it didn't try to execute the call, and then doesn't fail.
It refuses :auto
.
And, finally, both versions are 4.4.6
But I installed it directly on the machine, without Parallels. Here it accepts :auto
β05-16-2022 03:18 AM
Now, I'm facing another trouble!
The query with Λ:autoΛ runs nicely only in the browser, but if I run it using the Λcypher-shellΛ(.4.4.6 - the same as the server!) it fails.
ΛΛΛ
Invalid input ':': expected (line 1, column 1 (offset: 0))
":auto MATCH (n:Address)"
^
ΛΛΛ
The query is:
ΛΛΛ
:auto MATCH (n:Address)
CALL {
WITH n
DETACH DELETE n
} IN TRANSACTIONS;
MATCH (n:AddressType)
CALL {
WITH n
DETACH DELETE n
} IN TRANSACTIONS;
ΛΛΛ
Please, note 3 things:
if I remove Λ:autoΛthe query doesn't run on ΛbrowserΛ but runs on Λcypher-shellΛ
if I add Λ:autoΛ the query doesn't run on Β‘cypher-shellΛbut runs on ΛbrowserΛ
a curiosity: I showed you a query with two Λcall {...} in transactionsΛ. Well, they are two queries separated by a semicolon. On the browser, only the first need Λ:autoΛ while the second runs without it, and this is strange and curious.
β05-16-2022 06:06 AM
It looks like the cypher shell and browser donβt have the same behavior. It looks like the cypher shell only supports explicit transactions, while the βcall in transactionsβ is only allowed in implicit transactions. I guess this means it does not work in the shell.
β05-16-2022 06:18 AM
I think this is a thing that should be bring at the attention of the maintainer. I don't know how to.
In the meanwhile, I arranged to sed
a script ....
sed -f ./001_import_all.sed $1 > temp | cypher-shell -f temp -u neo4j >> 001_import_all.log 2>> 001_import_all.log
and import_all.sed
does the dirty work:
s/\(:auto\)//g
And this run with the call {} IN TRANSACTIONS
even in the cypher-shell, despite the manual!
But this is only a patch ....
All the sessions of the conference are now available online