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

AbstractVertxDAO.update() ignores optimistic locking #145

Open
badgerwithagun opened this issue Apr 19, 2020 · 6 comments
Open

AbstractVertxDAO.update() ignores optimistic locking #145

badgerwithagun opened this issue Apr 19, 2020 · 6 comments

Comments

@badgerwithagun
Copy link

As detailed here, jooq has inbuilt support for optimistic locking on updates.

However, the implementation of update(P object in AbstractVertxDAO ignores this.

The core logic is covered in org.jooq.impl.UpdatableRecordImpl#storeUpdate0.

@jklingsporn
Copy link
Owner

Thanks for your hint. vertx-jooq however does not support the record's store methods. In fact you should never use them when using vertx-jooq as well. I should probably overwrite these methods during code generation and let them throw an UnsupportedOperationException.
Reason being is that these methods bypass the QueryExecutors and will always use plain JDBC. There are also no future plans in supporting the Record's CRUD-methods.

@badgerwithagun
Copy link
Author

@jklingsporn I'm not suggesting the record's CRUD methods should be working.

I'm suggesting that the AbstractVertxDAO.update() method, which is part of this library, should handle optimistic locking columns in the same way as the record's CRUD methods and the normal j00Q DAOs.

That is, when I call AbstractVertxDAO.update() with a version column on my table, AbstractVertxDAO.update()`should execute, for example:

UPDATE Foo .... WHERE id = :id AND version = :version

Instead of

UPDATE Foo .... WHERE id = :id

It doesn't at the moment, which means the DAO can't be used for tables implementing optimistic locking.

@jklingsporn
Copy link
Owner

jklingsporn commented Apr 20, 2020 via email

@badgerwithagun
Copy link
Author

Is that also covered by plain jooq daos?

Yes - DAOImpl forwards to the record's CRUD methods!

@jklingsporn
Copy link
Owner

jklingsporn commented Apr 20, 2020 via email

@badgerwithagun
Copy link
Author

Will also look into it if I have time! Could you re-open the issue?

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