-
Notifications
You must be signed in to change notification settings - Fork 56
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] Issue with running queries in stream transaction #298
Comments
What you describe should just work fine. In order to debug it further, you can enable debug level logging for requests and response (logger In case this is a bug in ArangoDB Spring Data or in the underlying java driver, please provide a code snippet to reproduce the problem.
|
Hi! I think I might have found my mistake, I attempted to insert an edge entity in the following way: |
I don't think that Note that The latter is not exposed from Spring Data ArangoDB API, but only from the underlying Java driver. |
Checking the logs you recommended yields the following results:
Here is the test that resulted in the logs above, it is simply adding two nodes and an edge between them in the same transaction:
Important to note that if you take out the line querying the edge class (in which case no exception is thrown), after the transaction gets committed, the edge class can be queried from the database normally. (for example through executing arangoOperations.findAll(EdgeEntity.class)). Which means that adding the edge in transaction seems to work, but querying it does not.
Any suggestion as to how could this functionality be implemented would be highly appreciated. |
I've found another important part of the logs. |
Thanks for clarifying, you are correct: the mapping layer has no awareness of the transaction. This means that the queries issued to populate the relations properties (eg. fields annotated with To work around it, you could either:
For example, here is a slightly modified version of your code snippet that is working:
|
My team came to the conclusion that, though the solution you provided works, we would loose some functionality, because our business logic involves traversing edges using the @relations annotation, when referencing edges from a node, as well as it's fetch type, and direction. Your assistance would be greatly appreciated, |
Exactly, the transaction is not propagated to the methods responsible to fetch the linked entities. |
Yes, this does looks like, it would be an easier way for implementing transactionality, than my attempts at simply passing the transaction id everywhere. Would it be possible for you to give an estimate of what time frame these changes could be used in? I see there are changes from 2022, to last week. I'm asking because this might have an effect on what direction we would like to go, with our implementation. |
Unfortunately due to internal prioritization, the related work has not been planned yet. Note that the PR linked above is a community contribution. |
Would it be possible for you to give an estimate of when this bug might be fixed? |
Hi!
An application my team is building, uses arango database to process large chunks incoming data periodically.
For each individual batch of incoming data there is a large number of different db operations that have to executed (insertion, deletion, queries, updates etc.)
The current implementation has some performance issues, therefore we decided to rewrite the code responsible for executing these db operations to use arangodb's stream transaction.
The problem is, it seems that querying data, that has been added in the same transaction that it is being queried in, does not always return the legitimate results. I am currently experiencing this with edge collections.
We start the transaction the following way:
During this processing, if I try to query nodes that have been added in this same transaction, I can successfully achieve it like so:
But if I try to do the exact same logic, but instead of a collection annotated Document, it is one annotated Edge, the query always returns an empty response, even though I know, several instances of the given edge class have already been added. Apart from debugging I also know this, because after the transaction with given id is committed, the instances of the edge classes become immediately available.
I would appreciate help with this issue.
Additionally, I have another question, that is, whether the query method of the ArangoOperations class can only execute non-modifying queries, or any AQL statement provided as string (deletion for instance).
Thank you in advance.
The text was updated successfully, but these errors were encountered: