drogon icon indicating copy to clipboard operation
drogon copied to clipboard

ORM Concurrency Control

Open mike-5345 opened this issue 10 months ago • 2 comments

Notice If you need support or clarification regarding the usage of Drogon in your project, visit the official Drogon support channel at gitter

Please create a new issue only if you think you have found a bug or if have a feature request/enhancement.

Is your feature request related to a problem? Please describe. I am considering Drogon for a project but I am concerned that I have not found any reference to concurrency control in the ORM docs (pessimistic or optimistic).

Describe the solution you'd like I would like concurrency control for the ORM. Currently, as far as I am aware, there is no concurrency control. If there is one, does it use optimistic or pessimistic concurrency control?

Describe alternatives you've considered The company Code Synthesis offers C++ ORM called ODB. They implement optimistic concurrency control. Unfortunately they do not offer an asynchronous interface for their ORM.

mike-5345 avatar Mar 02 '25 19:03 mike-5345

@mike-5345 Thanks so much for your feedback. Yes, drogon's transaction does not provide such fine-grained control. Pessimism or optimism depends on the database configuration. We can consider adding it in the future. Do you have any good suggestions?

an-tao avatar Mar 03 '25 02:03 an-tao

Well I'm by no means an expert on this topic. ODB, the other ORM I mentioned, has a version column that is checked before every modifying transaction against version number the caller has in their object. The implementation throws if those version numbers are not the same prompting the caller to deal with the conflict.

I understand if this is beyond the scope of the project, but it would make Drogon a much more appealing offer.

Thanks for the prompt response.

mike-5345 avatar Mar 06 '25 01:03 mike-5345