Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Introduced pessimistic locks for derived queries. #720

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

Conversation

Copy link

@DiegoKrupitza DiegoKrupitza commented Feb 15, 2022

Methods which use the derive query functionality now can be annotated with @Lock to used a given LockMode. Right now there are two different modes PESSIMISTIC_READ and PESSIMISTIC_WRITE. Based on the dialect the right select is generated. For example for H2 Select ... FOR UPDATE.

Closes spring-projects/spring-data-relational#1041
Related tickets #643

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Methods which use the derive query functionality now can be annotated with `@Lock` to used a given `LockMode`. Right now there are two different modes `PESSIMISTIC_READ` and `PESSIMISTIC_WRITE`. Based on the dialect the right select is generated. For example for H2 `Select ... FOR UPDATE`.
Closes spring-projects/spring-data-relational#1041
Related tickets spring-projects#643 
Copy link
Member

mp911de commented Feb 21, 2022

Thanks a lot. It makes sense to have this, but we're in the process of moving Spring Data R2DBC into Spring Data Relational (side by side with JDBC) and we need to apply some refactoring in JDBC first before we can merge this one.

Copy link
Author

DiegoKrupitza commented Feb 21, 2022
edited
Loading

Thanks a lot. It makes sense to have this, but we're in the process of moving Spring Data R2DBC into Spring Data Relational (side by side with JDBC) and we need to apply some refactoring in JDBC first before we can merge this one.

No worries! In case you have questions about the locking implementation, I am glad to help, since I also implemented the same for spring-data-JDBC.

schauder added a commit to spring-projects/spring-data-relational that referenced this pull request Feb 22, 2022
This allows both Spring Data R2DBC and Spring Data JDBC to use the same annotation.
See /issues/1041, spring-projects/spring-data-r2dbc/pull/720, /pull/1158 
schauder added a commit to spring-projects/spring-data-relational that referenced this pull request Feb 22, 2022
This allows both Spring Data R2DBC and Spring Data JDBC to use the same annotation.
See /issues/1041, spring-projects/spring-data-r2dbc/pull/720, /pull/1158 
schauder added a commit to spring-projects/spring-data-relational that referenced this pull request Feb 22, 2022
Copy link
Contributor

Thanks, that's merged polished and merged into 3.0.x

DiegoKrupitza reacted with thumbs up emoji

@schauder schauder added type: enhancement A general enhancement and removed status: blocked An issue that's blocked on an external project change status: waiting-for-triage An issue we've not yet triaged labels Feb 22, 2022
@mp911de mp911de added this to the 3.0 M2 (202200) milestone Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API for pessimistic locks (SELECT ... FOR UPDATE)

AltStyle によって変換されたページ (->オリジナル) /