Commit Graph

801 Commits

Author SHA1 Message Date
Christoph Strobl
4227b99ff1 Prepare 7.3 M1 (2024.0.0).
See #2825
2024-02-16 14:37:00 +01:00
Gerrit Meier
e8d506c8c3 GH-2860 - Add explicit transaction boundaries.
If no transactional boundaries were set by the user,
Spring Data Neo4j would create new transactions (default read/write)
for the underlying database operations.

In cases where multiple statements are required to execute
a SDN operation this would mean that multiple transaction
would have been created.

This commit fixes this problem and creates new transaction if no
transaction was defined around the invocation of those units-of-work.

The change will introduce a breaking change:
All pure read operations in SDN (like Neo4jTemplate#findAll) will
now happen in read-only transactions.
If they contain custom statements with write operations,
they need to get wrapped in an explicit write transaction.

Closes #2860

Co-authored-by: Michael Simons <michael@simons.ac>
2024-02-12 11:49:16 +01:00
Gerrit Meier
f5d93fabf3 GH-2858 - Add re-population of properties and relationships during mapping.
Prior to this, an incomplete loaded entity, due to projection, was never
touched again to add missing properties loaded via a different relationship
and projection definition.

Closes #2858
2024-01-31 16:24:38 +01:00
Gerrit Meier
e50fd2e214 GH-2858 - Fix potential stackoverflow in recursive projections. 2024-01-31 16:10:55 +01:00
Gerrit Meier
caea3f10df GH-2858 - Fix following paths in projections.
If an entity has already been loaded by any relationship,
it gets marked as processed.
But this is not a valid state if there are multiple relationships
to this entity and it is loaded via different projections for each
relationship.
In those cases SDN will just stop to find other relationships.
This commit fixes this behaviour by also taking the relationship
the entity got loaded with into account.
2024-01-31 16:10:55 +01:00
Gerrit Meier
29737c32e9 Enhance warning message for missing entity ids. 2024-01-22 16:36:40 +01:00
Gerrit Meier
415ef6d48e Fix flaky test for findByExample. 2024-01-22 16:29:59 +01:00
Mark Paluch
bb97a751d7 Extend license header copyright years to 2024.
See #2852
2024-01-02 14:42:02 +01:00
Gerrit Meier
5caae70b1f Add logging section to appendix.
Don't know how this got lost.
2023-12-20 11:41:18 +01:00
Gerrit Meier
07de1c4a5c GH-2841 - Introduce new logging categories from the database.
Closes #2841
2023-12-13 15:32:22 +01:00
Gerrit Meier
bf44942cf2 GH-2782 - Optimize relationship processing.
For a lot of relationships on a self-referencing type (10k+),
the result will be in the format `n, collect(rel), collect(relNode)`.
This brings the whole bucket of `relNodes` every time as a mappable option
to the table.
Prior to this change, SDN would have to check this complete bucket for potential
matching nodes. Just to find out later that there is no relationship to map this one for.
Checking the relationship bucket first to find if there is a relationship at all
to find a target node for, improves the performance drastically.

Closes #2782
2023-12-12 16:45:37 +01:00
Gerrit Meier
b8bebe67ff GH-2819 - Improve parent type detection in result record.
Closes #2819
2023-12-12 10:21:26 +01:00
Gerrit Meier
d2e67bc19d Fix links in docs and move conversion to appendix.
Also re-introduce the old sections under the appendix chapter.
2023-11-30 13:12:50 +01:00
Michael Simons
1dc29c1de5 polish
See #2838
2023-11-28 16:15:06 +01:00
Michael Simons
9cd188286b Retain driver EventLoop during tests.
We now keep an instance to the event loop to avoid recurring recreation of threads.

Closes #2838
2023-11-28 16:10:18 +01:00
Michael Simons
16bbaf044f Allow enforcement to reuse a container in the CI build.
This orders reusable containers on wish and is meant for scenarios in which a CI does not allow "native" use of reusable test containers but will make sure to clean them up after CI ran. Export a variable `SDN_FORCE_REUSE_OF_CONTAINERS` as `true` and SDN tests won't close the container, regardless whether the underlying Testcontainers supports reuse or not.

Closes #2837
2023-11-28 13:59:42 +01:00
Akshat Shah
4eb08abade refactor: Extract requiresSingleStatements for better readability.
Co-authored-by: Michael Simons <michael@simons.ac>
2023-11-27 11:52:53 +01:00
Gerrit Meier
52f6714940 GH-2828 - Use correct node name related node in find by example.
Closes #2828
2023-11-22 13:27:33 +01:00
Runbing
709658c958 Fixed the URL for the Spring Data Commons documentation (#2827)
I fixed an incorrect URL in the **antora.yml** file that was preventing other pages from linking to the Spring Data Commons documentation.
2023-11-20 09:22:08 +01:00
Mark Paluch
e0f562b261 Prepare 7.2 GA (2023.1.0).
See #2813
2023-11-17 14:28:29 +01:00
Mario Ellebrecht
989b2a6918 Support ResultSummaries with Notifications with no InputPosition reported by the driver. (#2822) 2023-11-17 10:01:09 +01:00
Gerrit Meier
f5674afdad GH-2809 - Find the right id/element id function for assignedIds.
* Avoid using the outdated id function wherever possible.
* Never fall back to `toString(id((element))` (in Neo4j 4.4 scenarios)

Closes #2809
2023-11-09 16:57:16 +01:00
Dimitrios Begnis
2b73bde2f8 docs: Add missing types conversions to the documentation. (#2803) 2023-11-07 10:43:36 +01:00
Michael Simons
e4f034858a refactor: Avoid concurrency issues during some writes and reads. 2023-10-24 10:26:00 +02:00
Michael Simons
42d936ade4 fix: Sent bookmark updated event only while bookmarks are locked. 2023-10-19 18:16:59 +02:00
John Blum
b8db05939f Prepare 7.2 RC1 (2023.1.0).
See #2796
2023-10-13 08:43:55 -07:00
Gerrit Meier
52535f37f5 GH-2801 - Fix false positive mapping cycle detection.
Closes #2801
2023-10-11 15:52:39 +02:00
Michael Simons
d33425b154 fix: Unify Bookmarkmanager creation and usage for good. 2023-10-04 14:43:02 +02:00
Gerrit Meier
9a6490bfd2 GH-2800 - Introduce additional loggers for cypher notifications.
Closes #2800
2023-09-27 15:05:06 +02:00
Michael Simons
eb89011e4e Add missing runtime hints for imperative and reactive cypher dsl executors. 2023-09-26 16:51:42 +02:00
Gerrit Meier
be71c0da16 GH-2797 - Fetch current object's state from property accessor.
Before this change, the updated properties where ignored when there
was a call to a wither function for property setting.

Closes #2797
2023-09-25 14:53:00 +02:00
Michael Simons
0de04681b6 Add missing runtime hints for ReactiveBeforeBindCallback
See #2798.
2023-09-22 12:43:08 +02:00
Gerrit Meier
ccbd5eb5d9 GH-2791 - Support map with entity (list) as query parameter.
Closes #2791
2023-09-18 13:46:31 +02:00
Mark Paluch
b8d822300c Prepare 7.2 M3 (2023.1.0).
See #2778
2023-09-15 14:55:10 +02:00
Gerrit Meier
8c22618828 GH-2788 - Fix implementation class detection for Node annotated interfaces.
Closes #2788
2023-09-14 14:28:46 +02:00
Gerrit Meier
670dec536c Migrate documentation to Antora. 2023-09-11 09:21:01 +02:00
Michael Simons
2bc92b78ea Fix circular dependency of bookmarkmanagers. 2023-09-07 16:05:29 +02:00
Gerrit Meier
d208634ec0 GH-2784 - Switch between elementId and id in Cypher usage.
Works now with Neo4j 4.4 and 5.x.
Instead of having a unified return type (String) in the Cypher result,
SDN accepts now `Long` for id() and `String`.
The conversion will take place in the library code.

To switch between id() and elementId(), SDN will inspect the selected
CypherDSL dialect and select the needed identifier function accordingly.

Closes #2784
2023-09-06 06:56:23 +02:00
Gerrit Meier
cc696b9fa0 GH-2781 - Align mappingContext assignement in
ReactiveNeo4jAuditingRegistrar.

original change was introduced in 2b06d452
(Add AOT support)

Closes #2781
2023-08-30 18:09:18 +02:00
Michael Simons
6d58d80437 Fix synchronisation of bookmark access in reactive bookmark manager.
The separate reactive bookmark manager was introduced because Project Reactor and Blockhound have issues with the `ReentrantReadWriteLock` approach we have taken in the imperative approach.

The first approach was using a synchronized set, but as it was correctly noted by @seabamirum on #2769 this is not enough on the reading path:

> It is imperative that the user manually synchronize on the returned set when iterating over it:

(From the JavaDoc of `Collections.synchronizedSet`.

Using `ConcurrentHashMap.newKeySet` would solve that issue, but it would require a check for `null` values in the `usedBookmarks` argument for `updateBookmarks` AND it would also not solve the fact that removing the used bookmarks and adding the new ones is an atomic operation (such as it originally was in the imperative world).

So therefor it is just easier to use a standard set and synchronize over it.
2023-08-21 10:23:18 +02:00
Julia Lee
8f9a6c1629 Prepare 7.2 M2 (2023.1.0).
See #2766
2023-08-18 08:49:38 -04:00
Gerrit Meier
f1d40ccf5f Stabilize scrolling by example API tests. 2023-08-17 18:29:28 +02:00
Michael Simons
0b935eac2c Polishing. 2023-07-24 08:42:13 +02:00
Dmitriy Tverdiakov
5e6b1ea208 Make ReactiveDefaultBookmarkManager return a copy of bookmarks (#2769)
This update makes sure that the `ReactiveDefaultBookmarkManager` returns an unmodifiable copy of its current bookmarks instead of returning a view of the bookmarks.
2023-07-24 08:11:42 +02:00
Mark Paluch
33bfff0f57 Prepare 7.2 M1 (2023.1.0).
See #2723
2023-07-14 14:52:12 +02:00
Gerrit Meier
21c8a42b29 GH-2755 - Use bookmark manager in Client.
Also make the `AbstractNeo4jConfig` and its reactive counter-part
use the same defined bookmark manager in transaction manager and
client.

Closes #2755
2023-07-12 14:49:04 +02:00
Gerrit Meier
47feb15244 GH-2763 - De-Lombok all the things.
Closes #2763
2023-07-10 10:43:03 +02:00
Gerrit Meier
804a954a1a GH-2750 - Avoid toString in relationship creation.
Without the string conversion Neo4j will either to an (element)id or
label seek instead of a full node scan.
Also: In some corner case adding labels to the generic cyclic query
can improve the performance of the query.
On the other hand it cannot make it worse.

Closes #2750
2023-06-29 08:51:57 +02:00
Gerrit Meier
0124f32b7e GH-2749 - Skip relationship mapping if no relationships are available.
Closes #2749
2023-06-26 13:19:06 +02:00
Gerrit Meier
85d2288b6b GH-2748 - Fix property filter in FluentQuery....
Using FluentQueryByExample/Predicate with a subset of properties,
the underlying fetching mechanics in the Neo4jTemplate was still
querying for everything if the domain has a potential circular dependency.

Closes #2748
2023-06-19 16:00:15 +02:00