Skip to content

NH-2285 - Support for LockMode in linq provider #304

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

Closed
wants to merge 3 commits into from

Conversation

OnurGumus
Copy link
Contributor

reimplemented the ffix

@hazzik hazzik changed the title Nh 2285 NH-2285 - Support for LockMode in linq provider Nov 18, 2014
@hazzik hazzik added this to the 4.1.0 milestone Nov 18, 2014
@oskarb
Copy link
Member

oskarb commented Nov 20, 2016

What bothers me a bit with this is that while the test cases hypothetically will execute the code and implicitly verify that there are no exceptions, they don't actually verify that the requested locking has been applied.

@oskarb
Copy link
Member

oskarb commented Nov 20, 2016

It's unfortunately also vulnerable to caching issues:

var result1 = (from e in db.Customers
                     select e).SetLockMode(LockMode.Upgrade).ToList();
var result2 = (from e in db.Customers
                     select e).SetLockMode(LockMode.UpgradeNoWait).ToList();

If the above two statements are executed, the second query will reuse LockMode.Upgrade from the first query.

@oskarb
Copy link
Member

oskarb commented Nov 20, 2016

I've rebased and submitted a version with improved test cases as PR #530. It shows some more work is required.

@oskarb oskarb closed this Nov 20, 2016
@oskarb oskarb removed this from the 4.1.0 milestone Nov 20, 2016
@oskarb oskarb removed the to review label Nov 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants