-
Notifications
You must be signed in to change notification settings - Fork 617
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
Neo4jTemplate.DefaultExecutableQuery.getSingleResult() always executes in non-readonly transaction #2953
Comments
Thanks for reporting this. Unfortunately in this case, there is -at least from my current perspective- less we can do about this situation. |
Hi @meistermeier, Thanks for the prompt response. From what I can see at first glance, it looks promising to first fix the call-scopes in Neo4jTemplate directly. One way to go about this, would be to allow the transaction to be optionally passed down to |
If you want to do this in a PR, I am happy to have a look. Personal addition: When you filed your PR, please don't expect a quick response within the next two weeks because I will be on vacation. |
Sounds good to me, thx. 👍 |
@meistermeier Have a look at #2962 at your convenience. Happy to update if you have any remarks. |
When activating
Neo4jTransactionManager.setValidateExistingTransaction(true)
a simplefindById()
will result in anIllegalStateException
. This is due togetSingleResult()
always executing in the default transactional-templatehttps://github.com/spring-projects/spring-data-neo4j/blob/main/src/main/java/org/springframework/data/neo4j/core/Neo4jTemplate.java#L1277
whereas the outer call
findById()
executes in a readonly-transaction.https://github.com/spring-projects/spring-data-neo4j/blob/main/src/main/java/org/springframework/data/neo4j/core/Neo4jTemplate.java#L338
How to reproduce:
findById()
on a neo4j-template or -repositorySee also
The text was updated successfully, but these errors were encountered: