Open rashtao opened 6 months ago
This looks like a good baseline to implement #80, will rebase afterwards!
not sure, but looking into ArangoResultConverter
there seems to be a break. Maybe adding the stream transaction id to the ArangoExtCursor
(if cursor of that type) could help to pass a tx-context to the converter in buildGeoResult()
?
@aburmeis
thanks for the feedback. This is still WIP, ArangoResultConverter#buildGeoResult()
code paths are indeed not covered yet.
Blocked by BTS-1859
This PR is currently on hold, since use of stream transactions in Spring Data is constrained by a limitation in ArangoDB affecting AQL cursors within stream transactions (BTS-1859). Currently, a AQL cursor not consumed completely (i.e. a stream cursor or a cursor returning multiple batches) blocks other requests using the same transaction. For example, it blocks mapper requests to fetch linked entities.
The issue has been internally reported and is now being scoped and prioritized.
This PR fixes the resolution of linked entities ( eg. referenced in fields annotated with
@From
,@To
,@Ref
… ) within a stream transaction. The linked entities are resolved using the same stream transaction used to retrieve the container entity (if any).This applies to entities retrieved using repositories, template operations as well as using the underlying Java driver directly.
Lazy relations are also resolved using the same transaction. If the transaction has been already committed or aborted when the proxy is resolved, then an exception will be thrown. The user is responsible to initialize all the lazy associations prior to committing or aborting the transaction.
fixes #298