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>
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
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.
Yes, it brings a congnitive challenge right now,
but on the other hand the refactoring of the
`DefaultNeo4jEntityConverter#createInstanceOfRelationships`
is a challenge on its own.
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
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
This change publishes a build scan to ge.spring.io for every local build from an authenticated Spring committer and for CI where appropriate access tokens are available. The build will not fail if publishing fails.
This change also allows the build to benefit from local and remote build caching, providing faster builds for all contributors.
Additionally, the project will have access to all features of Gradle Enterprise such as:
- Dashboards to view all historical build scans, along with performance trends over time
- Build failure analytics for enhanced investigation and diagnosis of build failures
- Test failure analytics to better understand trends and causes around slow, failing, and flaky tests
See #2811