Any Optimistic Concurrency Control support (MS SQL Server)?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start at SQLProvider's SubmitUpdates() behavior for MSSQL and reproduce the described two-session update using a TIMESTAMP column. Done means a concurrent update causes a runtime error and leaves the database unchanged; the issue does not name specific source files or tests.
Written by the indexing model from the issue text.
Description
Description
I'm looking for a way to add Optimistic Concurrency Control in SQLProvider, based on TIMESTAMP columns (MSSQL). Similar to how it is done in Entity Framework.
Is there anything built-in? If not then a workaround or an extension?
Repro steps
-
Create context, read a record from a table with TIMESTAMP column.
-
Update some property of the record.
-
Hit the breakpoint to make debugger stop just before ctx.SubmitUpdates(). Run the code in debugger.
-
Concurrently update the record in MS SQL server (e.g. via SQL Management Studio) so record read in Step 1 becomes obsolete
-
Resume debugger and execute ctx.SubmitUpdates()
Expected behavior
A runtime error saying that record was updated concurrently, no changes in database.
Actual behavior
SubmitUpdates() writes changes to database, regardless whether timestamp is obsolete or not.
Known workarounds
Don't know any out of the box. A stored procedure can be written instead which is tedious.
Related information
- Used database: MSSQLSERVER
- Operating system: Windows 10
- .NET Core 2.1
- Dominant language
- F#
- Stars
- 627
- Forks
- 147
- Avg merge
- 2h 2m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fsprojects/SQLProvider
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
fsprojects/SQLProvider#872 · 2 comments ·
-
Repo Assist? Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 10/100
fsprojects/SQLProvider#870 · 1 comment ·
-
postgresql
Difficulty 4/5 3-5 days Newbie friendliness 58/100
fsprojects/SQLProvider#869 · 2 comments ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
fsprojects/SQLProvider#868 · 2 comments ·
-
sql server
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fsprojects/SQLProvider#851 · 1 comment ·
All issues in fsprojects/SQLProvider
Similar issues
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
community-scripts/ProxmoxVE#17396 · 1 comment ·
-
bug possible-duplicate
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/PictoPy#1553 · 4 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BasedHardware/omi#15274 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100