0

I just encountered an interesting behaviour with Spring Data for Neo4j, and I'm wondering if it is my mistake, or some strange bug.

I am attempting to save the collection of neo4j entities all at once. The method signature promises to return an instance of Iterator over these just saved entities. I am assuming that the result will be Iterator over persited entities, containing newly assigned IDs. However, return value is null, unlike calling a save operation over single entity:

Iterable<PhysicalMachine> savedPMs = this.physicalMachineRepository.save(pms);

Data is persisted, and I can see it in the database right after the call (even during debugging). However, "savedPMs" is null, which of course throws a null pointer in the next call...

Am I missing something trivial here?

Vanja Lee
  • 263
  • 4
  • 17

1 Answers1

1

This was fixed in 4.1.1.RELEASE, see https://jira.spring.io/browse/DATAGRAPH-760

Note:

It's also recommended that you upgrade to 4.1.1, there aren't any fixes happening in the 4.0 line. Theres a short guide to upgrading here: http://graphaware.com/neo4j/2016/02/24/upgrading-spring-data-neo4j-4-1.html

Luanne
  • 19,145
  • 1
  • 39
  • 51
  • Thank you for your advice. I tried updating it, but I was not quite successful (probably due to different internet pages telling different things), so I decided to stay in this version for a little bit longer. Is the new version backwards-compatible? Is it possible to use neo4j 2.3.4 with sd-n4j 4.1.1 without rewriting old queries (and entities)? I have quite a lot of them, and most of them return Lists, instead of Iterator instances. – Vanja Lee Jun 06 '16 at 17:10
  • 1
    Ae you upgrading from SDN 3 to SDN 4.1.1? If so, they are not completely backward compatible. If you're migrating from SDN 4 to 4.1 then you should be fine- there are changes to the configuration, and queries cannot return paths, but other than that, many improvements in 4.1 – Luanne Jun 07 '16 at 03:06
  • I managed to migrate successfully, but I now wonder if there is a way of disabling logging in HTTP driver, for each executed query. I execute a lot of queries in a very short span, and until now I had my own built in solution for enabling and disabling logs. However with new driver, every HTTPRequest is logged and my console is flooded :) – Vanja Lee Jun 19 '16 at 11:24
  • Found a solution. Use custom logback.xml and supress info logs there. http://logback.qos.ch/manual/configuration.html – Vanja Lee Jun 20 '16 at 18:45