Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DE-771] stream transactions mapping #303

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rashtao
Copy link
Collaborator

@rashtao rashtao commented Apr 10, 2024

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

@aburmeis
Copy link
Contributor

This looks like a good baseline to implement #80, will rebase afterwards!

@aburmeis
Copy link
Contributor

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()?

@rashtao
Copy link
Collaborator Author

rashtao commented Apr 15, 2024

@aburmeis
thanks for the feedback. This is still WIP, ArangoResultConverter#buildGeoResult() code paths are indeed not covered yet.

@rashtao rashtao marked this pull request as ready for review April 17, 2024 18:53
@rashtao
Copy link
Collaborator Author

rashtao commented Apr 22, 2024

Blocked by BTS-1859

@rashtao rashtao marked this pull request as draft April 22, 2024 08:58
rashtao added a commit that referenced this pull request Jun 19, 2024
rashtao added a commit that referenced this pull request Jun 19, 2024
rashtao added a commit that referenced this pull request Jun 19, 2024
* added changes from #303

* added test changes from #303
@rashtao rashtao force-pushed the feature/stream-transactions branch from 961e480 to 65023bc Compare June 19, 2024 20:24
@rashtao
Copy link
Collaborator Author

rashtao commented Jul 20, 2024

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.

See https://github.com/arangodb/spring-data/pull/303/files#diff-e1d2b6243110880918936e9a2f935bd6bf28cc7eef693ab5a9fbe9fe7ecbf179L17-L21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DE-771] Issue with running queries in stream transaction
2 participants