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

Nolocking mechanism implemented for #1637 #1823

Merged
merged 1 commit into from
Mar 6, 2017
Merged

Nolocking mechanism implemented for #1637 #1823

merged 1 commit into from
Mar 6, 2017

Conversation

osoykan
Copy link
Contributor

@osoykan osoykan commented Jan 31, 2017

I implemented With Nolock interception for select queries on Repository level. I wrote test, but Effort does not generate Sql statements while interception time, so i tested local sql server on my computer and it works.

If you have a chance to review would be great!

Thanks in advance.

@hikalkan hikalkan added this to the v1.5.0 milestone Feb 2, 2017
@hikalkan
Copy link
Member

hikalkan commented Feb 2, 2017

Thank you @osoykan I'll review it.

@hikalkan hikalkan self-requested a review March 6, 2017 10:46
{
using (nolockInterceptor.Object.UseNolocking())
{
result = queryable(repository.GetAll());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@osoykan is that working? I'm asking because Queryable is executed deferred (after nolockInterceptor.Object.UseNolocking() is disposed). Have you tested this PR with a real database?
Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we return again IQueryable from Nolocking, yes you are right, but we need to write executer methods in Nolocking

Also, I tried before and currently using in production but not abp based source code.

For example:

Person person = _personRepository.Nolocking(persons => persons.FirstOrDefault(x => x.Name == "halil"));

FirstOrDefault forces Quearyable to execute on result = queryable(repository.GetAll()); statement. Actually user should provide executer methods like FirstOrDefault, ToList(), Count() etc...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that's good. Thank you for explanation.

@hikalkan hikalkan merged commit 09b0064 into aspnetboilerplate:dev Mar 6, 2017
@hikalkan
Copy link
Member

hikalkan commented Mar 6, 2017

@osoykan I just added the interceptor in AbpEntityFrameworkModule: 70caae9
I suppose no problem with that.

@osoykan
Copy link
Contributor Author

osoykan commented Mar 6, 2017

@hikalkan, no problem, seems okay. But I was wondering, why did you use lock object?

@hikalkan
Copy link
Member

hikalkan commented Mar 6, 2017

For unit tests.

DbInterception.Add is a static method and unit tests can run in parallel. So, we should call DbInterception.Add only one time and in a thread safe way.

@osoykan osoykan deleted the feature-1637 branch March 6, 2017 19:55
ShiningRush added a commit to ShiningRush/aspnetboilerplate that referenced this pull request Mar 17, 2017
* Nolocking extensions implemented for aspnetboilerplate#1637

* Add EfCoreTransactionStrategy

* Implement EfCoreTransactionStrategy

* Abp.Dapper package implemented for aspnetboilerplate#1661

* Dapper packoptions added on project.json

* Abp.Dapper tests added

* refactor for aspnetboilerplate#1661

* resolved aspnetboilerplate#1907

* Resolved aspnetboilerplate#1847: Trigger AbpHandledExceptionData for hangfire jobs too.

* Fixed aspnetboilerplate#1875: Tenant Resolve Contributer renamed to Contributor (typo fix)

* Resolved aspnetboilerplate#1886: Make TestAbpSession methods and properties virtual to allow overriding.

* Use existing connection in the demo if available for EF Core.

* aspnetboilerplate#1909: Refactor EF Core transaction strategy. Pass conn string to options builder.

* aspnetboilerplate#1909 refactored DbContextEfCoreTransactionStrategy

* aspnetboilerplate#1854 Correct version in project.json for dapper package.

* Add Abp.Dapper to pack.ps1.

* Resolved aspnetboilerplate#1827: Depend on JetBrains.Annotations instead of including annotations in Abp package.

* Resolved aspnetboilerplate#1864: Set Http Status to 400 for validation exceptions.

* Add WithNoLockInterceptor in AbpEntityFrameworkModule aspnetboilerplate#1823.

* Resolved aspnetboilerplate#1892: Load plugin dependencies from plugin folder.

* Incremented version to 1.5.0.0.

* Resolved aspnetboilerplate#1915: Upgrade to AspNet Core v1.1.1.

* Open solution on VS 2017, make it building (but not passing all unit tests yet).

* Upgraded xunt and other nuget packages.

* Create nuget packages after build.

* Create Abp-fa.xml

* Added bindings based on microsoft/vstest#428 to be able to run unit tests for aspnet core.

* Passed all unit tests by applying microsoft/vstest#428

* Remove solution folder.

* Change pack.ps1 for msbuild

* Revised nuget packaging.

* Fix appveyor.xml.

* Move common project properties to a single file. Revise pack.ps1.

* Change sln format.

* update appveyor file

* added RuntimeIdentifier.

* Fix test dll paths in appveyor.xml

* Temporarily remove NH tests for appveyor.

* Check matched count on DomainTenantResolveContributor

* Fixed aspnetboilerplate#1928: Fix Dapper namespaces.

* Fix default namespaces for projects.

* Resolved aspnetboilerplate#1934: Upgrade nuget package dependencies.

* Fixed aspnetboilerplate#1923: Web API [DontWrapResult] Not Working with [AbpApiAuthorize]

* Fixed aspnetboilerplate#1918: Can not handle model binding validation errors for dynamic web API actions.

* aspnetboilerplate#1936 Remove Abp dependency from Abp.Web.Resources package.

* Fixed aspnetboilerplate#1936: Abp.Web.Resources contents become flat with 1.5.1 release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants