Investigate using "SELECT FOR UPDATE" for modes that do change tracking #2802
Replies: 9 comments
-
From a Gitter conversation today: Another option for 4.) above is to add overloads of Load/LoadMany for LoadForUpdate(), and add a new Linq extension for IQuerySession.Query().ForUpdates().Where(expression)that issues the SELECT with FOR UPDATE. Feedback from 2nd Quadrant is leading us to being more fine-grained about it |
Beta Was this translation helpful? Give feedback.
-
I think this is good stuff! The finer lock looks better than using serializable. |
Beta Was this translation helpful? Give feedback.
-
I took a stab at this earlier this week and it turned out to be way harder than I anticipated, just due to Marten's internals and how it generates SQL. It would be relatively simple to do:
My question to everyone else is can we say that the above proposal is good enough for now and we'll worry about adding row locking to Linq queries later? |
Beta Was this translation helpful? Give feedback.
-
Can we also include
http://highscalability.com/blog/2015/10/13/more-concurrency-improved-locking-in-postgresql.html |
Beta Was this translation helpful? Give feedback.
-
@jeremydmiller So there is no way (hacky or otherwise) to do a row lock with Marten v3 or v4? |
Beta Was this translation helpful? Give feedback.
-
Yes in the event store, no in the document db until this story is played. Wanna volunteer? :-) I think it'll be easier in v4 after all the changes to internals. I thought about doing this as part of v4 a couple times, but the release dragged on for too long as it was. |
Beta Was this translation helpful? Give feedback.
-
Understood. I'll pass for now on volunteering. ;-) And thanks for your great work! Marten has simplified quite a bit for us! So far it's the best way (I've used) to persist a DDD domain. |
Beta Was this translation helpful? Give feedback.
-
And sadly enough, this gets kicked back yet again! |
Beta Was this translation helpful? Give feedback.
-
Moving this to discussion, we can bring it back into issues when we actually look at this. |
Beta Was this translation helpful? Give feedback.
-
This will help lock the row up front for updates if we already know updates are planned via change tracking. This may or may not be that big of a deal though.
Beta Was this translation helpful? Give feedback.
All reactions