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
Select for Update default implementation in AbstractSqlLikeQueryBuilder
#1330
Comments
The method is left for the actual implementation to be implemented, ordinary sql vs jpql. What is your use case of implementing the builder? |
Oh I get it. So we hit this error when using the
So I think our real request is if |
Correct me if i’m wrong but I don’t think JPA / Hibernate supports FOR UPDATE in the query. That’s why I added the error. Did it work for you before? |
Ahh I see. I think it was just a no-op before and wasn't doing anything then. From what i'm reading, it looks like in JPA that one needs to set the locking strategy to use "for update"? Like this: https://mobiarch.wordpress.com/2013/08/01/doing-select-for-update-in-jpa/ Is this something possible to set in the query builder? Or if not, how would we be able to use select-for-update functionality? |
The best solution would be to introduce a new annotation that would have LockModeType and then set it in the Hibernate repository implementation. |
Ok, thanks for the infos. Gonna close this. |
Feature description
We recently upgraded micronaut versions and hit an error that Select For Update was not supported by
AbstractSqlLikeQueryBuilder
:Wondering if there could just be a default impl that appends a
for update
to a select query in the right place? If not, then wanted to know why it is unimplemented, and how we could take advantage of it in repository methods?The text was updated successfully, but these errors were encountered: