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

Support optimistic locking via JPA #1952

Closed
AlecKazakova opened this issue Sep 15, 2020 · 8 comments
Closed

Support optimistic locking via JPA #1952

AlecKazakova opened this issue Sep 15, 2020 · 8 comments

Comments

@AlecKazakova
Copy link
Collaborator

see https://www.baeldung.com/jpa-optimistic-locking

or maybe not via JPA, but this seems important!

@cgruber
Copy link

cgruber commented Dec 1, 2021

Any inclinations about this. This is definitely a show-stopper for one of our use-cases.

@AlecKazakova
Copy link
Collaborator Author

yes but it wont be anything where we write SQL for you, so you'll still have to write

UPDATE blah
SET foo = bar
WHERE version = 3;

and if you omit the version part we will fail the build, and maybe show an intention action on the query like "this needs an optimistic lock" and then you option+enter and it just adds it for you.

@AlecKazakova
Copy link
Collaborator Author

I'm open to other ideas though, and this is something I intend to have in the 2.0 release

@cgruber
Copy link

cgruber commented Dec 8, 2021

That seems pretty reasonable, as a way to offer the functionality. I could see some universe where we all had more time, where you could annotate a version field or something, or annotate an opt-lock constraint (just write the where clause) but as long as you CAN do this, and as long as the build fails if you miss it, I can see it being workable.

@AlecKazakova
Copy link
Collaborator Author

👍 i'll aim for that for next release since I think its pretty straightforward

@cgruber
Copy link

cgruber commented Jan 31, 2022

We're looking at evaluating using sqldelight in some hibernate cases, and this one is going ot be pretty important. I'm not clear on your timeline for 2.0 or whichever "next release" you are thinking of. Any (non-binding) notion of a timeline? I'd hate to end up on Jooq merely because of a disqualifying missing feature.

@AlecKazakova
Copy link
Collaborator Author

Not concretely, I'm hoping march. However I've been doing internal releases for Cash, I can just publish another one once this feature is done which would be a much shorter timeframe (like 2 weeks?)

@cgruber
Copy link

cgruber commented Jan 31, 2022

That would be dope. 🙏🏼

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

No branches or pull requests

2 participants