Do you recommend any workaround or suggestion?
Also, I have following timeout set
public iVend365DbContext(DbContextOptions<iVend365DbContext> options) : base(options) { Database.SetCommandTimeout(1000); }
Yes, I am trying to creating tenant on Azure. At times it creates successfully. But at times it fails with the following error. Please advice.
Exception: System.InvalidOperationException: Internal .Net Framework Data Provider error 6. at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.b__0(DateTime giveUp) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_0
2.b__0(DbContext c, TState s) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func
3 verifySucceeded) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, Func2 operation, Func
2 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.Create() at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator1.CreateOrMigrate(AbpTenantBase tenant, Action
1 seedAction) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator1.CreateOrMigrateForTenant(AbpTenantBase tenant, Action
1 seedAction) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator`1.CreateOrMigrateForTenant(AbpTenantBase tenant) at CitiXsys.iVend365.MultiTenancy.TenantManager.d__15.MoveNext() in D:\Development\CXSRetail\Development\iVend365\src\CitiXsys.iVend365.Core\MultiTenancy\TenantManager.cs:line 192
Hi,
Apart from slow performance, it also throws Internal Error at times. The error is not consistent in nature, At times it creates the tenant successfully (though its slow), but at times it also fails. When it fails, it even not creates the database. The internal error that gets thrown at times is what we are more worried about. We have around 50 tables apart from the one that ABP and ASPNetZero have. Please advice...
Regards, Mahendra
Hi,
While we create a new tenant on azure it takes almost 3 to 5 minutes to create a new tenant. While analyzing where exactly it is taking time, we found that the following statement in the TenantManager.cs class takes too much of time to finish execution. _abpZeroDbMigrator.CreateOrMigrateForTenant(tenant);
Any idea what must be wrong? Please advice how can we increase the performance of creating a new tenant?
Regards, Mahendra
Hi, We have a requirement that whenever a new tenant database is created it should automatically be added to a SQL Elastic Pool. Has anyone implemented the same?
Hi ismcagdas,
I have successfully implemented the tenant wise logging by walking your recommendation. Thanks for your support..
Regards, Mahendra
Hi,
" You also need to repalce IAuditingStore in the PreInitialize of your web module like this: Configuration.<IAuditingStore, MyAuditingStore>(DependencyLifeStyle.Transient); "
I am using .Net Core MVC with JQuery version of ABP. In my PreInitialize method of WebMvcModule I don't see the line that you mentioned above to replace. Please advise where to register my class.
I have created the following class in Application project. Here is the code.
namespace CitiXsys.iVend365.Auditing { public class CustomAuditing: AuditingStore { public CustomAuditing(IRepository<AuditLog, long> auditLogRepository):base(auditLogRepository) {
}
public override Task SaveAsync(AuditInfo auditInfo)
{
//Check the Tenant here and if logging is not required return from here else call the SaveAsync method of base.
return base.SaveAsync(auditInfo);
}
}
}
Regards, Mahendra
Hi ismcagdas,
thanks for your reply.
I don't want to loose whatever is getting logged by ABP or Module Zero. All I need the flexibility to log only for certain tenants and not for all tenants. I suspect, if I walk the path that you mentioned, then in that case I may loose all the default logging that ABP or Module Zero is doing. Correct me If my suspicion is wrong.
Regards, Mahendra
Hi,
I would like to disable the audit log for an individual tenant through a setting. When I say disable audit log, I essentially means neither it should write in Logs.txt file nor it should write in ABPAuditLogs table. Is this available out of the box? If yes, how to configure? If No, can you please recommend how can we achieve this?
Regards, Mahendra