Base solution for your next web application

Activities of "leonkosak"

Hi,

Based on ABP documentation for Background workers (https://aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers#background-workers), I am wondering how is the most convenient way for running the same worker on all databases (tenant databases)?

  1. Make one instance of background worker and inside worker switching between database contexts (tenant databases) or
  2. Make an instance of background worker for each tenant on application startup and somehow inject tenant to background worker instance?

I have strictly separated databases for each tenant and none is using a host database.

Thank you for explanations.

Thank you. :) It works. Just two minor code additions in root-routing.module.ts and login.component.ts.

I think that ANZ should have option resolving tenant based on URL parameters (not just via subdomains). Not all customers have abilities to provide such infrastructure.

Crap! :( I would also need host.

I agree, but for testing environment, we (our customer) does not have option for URL tenant subdomains. This is LOCAL INSTALLATION and only one tenant is defined (in use). There will be different in production (tenant subdomains).

One of our customers wants that tenant is automatically selected when a user comes to login page (because all application is "inside" tenant and not host). Users should not be aware of tenant, because they are confused. However, this customer currently does not have any options that we could "solve" this issue by URL tenant resolving ({TENANCY_NAME}).

Is somehow possible, that one tenant is selected by default (for instance "Default" tenant or any other) and if administrator wants to enter in host, he would change this on login page explicitly (write empty string in modal window on login page when changing tenant)?

Thank you.

ANZ is currently not prepared for In-Process hosting model. There was an issue on GitHub for this particular feature, but was not implemented because of some difficulties.

That's absolutely true what Ismail wrote. Aprox. 2 years ago, I started with ASP.NET Boilerplate and then ASP.NET Zero based on .NET Framework and jQuery. I have basically no knowledge of Angular (and no experience with ABP/Zero architecture and practices). But I have courage to start enterprise project with .NET Core and Angular based on ANZ and today I can say that learning ANZ/ABP and Angular (and a little .NET Core) was the best stack which boost my productivity multiple times and even beta versions of software is much more stable than ever.

@commondesk: It's not fair that you blame application framework for not knowing library or framework "inside" ABP/ANZ. Just accept reallity - modern full-stack web is noticeable more complex than native (desktop and other native) frameworks. There are so many libraries and frameworks and each of them have active development. After all -in ANZ you have plenty of Angular/C#/... examples. Of course, there is always room for improvements (like going towards Reactive Forms in Angular projects,...), but with ABP/ANZ learning courve is much faster. The only real competition to ABP/Zero is Orchard Core platform mostly because of upgradability (which will be solved with abp.io).

Yes, I know and it is much faster. Maybe I have to move this varbinary data to seperate table, so that EF won't load it by default.

With ExecuteSqlCommand method, you lose advantages of strongly-typed queries.

ERROR 2019-04-26 04:39:02,652 [23 ] Mvc.ExceptionHandling.AbpExceptionFilter - An error occurred while updating the entries. See the inner exception for details. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- End of inner exception stack trace --- at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__122_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary2 parameterValues, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) --- End of inner exception stack trace --- at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Abp.EntityFrameworkCore.AbpDbContext.SaveChangesAsync(CancellationToken cancellationToken) at Abp.Zero.EntityFrameworkCore.AbpZeroCommonDbContext3.SaveChangesAsync(CancellationToken cancellationToken) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChangesInDbContextAsync(DbContext dbContext) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChangesAsync() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.CompleteUowAsync() at Abp.Domain.Uow.UnitOfWorkBase.CompleteAsync() at Abp.AspNetCore.Mvc.Uow.AbpUowActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync() INFO 2019-04-26 04:39:02,721 [23 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2019-04-26 04:39:02,786 [23 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action xxxx (xxxx.Application) in 31729.9908ms INFO 2019-04-26 04:39:02,847 [23 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 32032.3872ms 500 application/json; charset=utf-8

This is from Logs.txt file. There is no record in AbpAuditLogs table.

I will post it tomorrow. But anway: There is no problem if query is without binary data filed included. On local installations, there is no such problem, but execution time is really slow.

Showing 31 to 40 of 55 entries