Base solution for your next web application

Activities of "AuroraBMS"

also the UI for the default theme is still broken in this version after being deployed

Running this command will resolve you EF issue: dotnet tool install --global dotnet-ef

Found the issues. Default tenant is not seen as the main host but rather just another instance/tenant. So in order to actually access the real host on the system you have to untick the tenant and not handle the default tenant as the host and other tenants added on later as tenants only.

@bartkoolhaas check if you untick tenant after opening the site you should be able to see your menu's if multi tenancy is enabled for you.

  • What is your product version?
    • 10.30
  • What is your product type (Angular or MVC):
    • Angular
  • What is product framework type (.net framework or .net core)?
    • .net Core

Good day ANZ Team,

I have a few questions regarding the Xamarin part of the solution:

  • Is there any way to specifically make the solution work offline and only go online once internet access is received or refresh is run?
    • The need for this comes in when working in rural areas or areas that do not have signal due to environment or restrictions.
    • The issue comes in when closnig the app completely it requires re-auth once starting up again.

-In the Xamarin project I found these 2 entries under class XamarinSharedModule: - Configuration.Localization.IsEnabled = false; - Configuration.BackgroundJobs.IsJobExecutionEnabled = false;

What exactly does those 2 fields allow for the xamarin project? I know Configuration.BackgroundJobs.IsJobExecutionEnabled from the standard project but not sure if this is some sort of job execution for the mobile device itself and if so how is it used?

Thanks in advance!

HI @ismcagdas,

I'm experiecning the same issue currently.

I've tried using the bulk insert as well now. It was however on a freshly created project with a bunch of standard entities created without any custom code yet.

I've had this a few times when trying to use it on a from scratch project when you migrate versions and have been getting it for a while now. Attempted to use it with 11.0.1 now again as I am getting stuck on standard repository functions not working with hangfire. Below is the error:

ERROR_005: The monthly trial period is expired (2022-01-01). You can extend your trial by downloading the latest version as the beginning of every month. More information can be found here: https://entityframework-extensions.net/trial

System.Exception: ERROR_005: The monthly trial period is expired (2022-01-01). You can extend your trial by downloading the latest version as the beginning of every month. More information can be found here: https://entityframework-extensions.net/trial at .(ProviderType , Boolean , Boolean , Boolean , Boolean ) at Z.BulkOperations.BulkOperation.Execute() at Z.BulkOperations.BulkOperation.BulkInsert() at .BulkInsert[T](DbContext this, IEntityType entityType, IEnumerable1 list, Action1 options, SavingSelector savingSelector, Boolean forceSpecificTypeMapping) at .BulkInsert[T](DbContext this, IEnumerable1 entities, Action1 options, Boolean isBulkSaveChanges) at .(DbContext this, List1 , Action1 ) at .(DbContext this, StateManager , IReadOnlyList1 , Action1 ) at .(DbContext this, StateManager , IReadOnlyList1 , Action1 ) at .(DbContext this, Action1 , DbContext ) at DbContextExtensions.BulkSaveChanges(DbContext this, Action1 options) at DbContextExtensions.BulkSaveChanges(DbContext this) at BRM.Web.Startup.Hangfire.DataSyncs.Inbound.BusinessPartnerMasterDataInboundSync.Execute(Int32 number) in C:\Users\user\Source\Repos\BRMV11.0.1\aspnet-core\src\BRM.Web.Host\Startup\Hangfire\DataSyncs\Inbound\BusinessPartnerMasterDataInboundSync.cs:line 149 at Castle.Proxies.BusinessPartnerMasterDataInboundSyncProxy.Execute_callback(Int32 number) at Castle.Proxies.Invocations.BusinessPartnerMasterDataInboundSync_Execute.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation) at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.BusinessPartnerMasterDataInboundSyncProxy.Execute(Int32 number)

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version?
    • V11.0.1
  • What is your product type (Angular or MVC)?
    • Angular
  • What is product framework type (.net framework or .net core)?
    • Core

Good day ANZ team,

We are busy updating to V11.0.1 and attempting to implement Hangfire jobs for bulk data syncing. Previously we used to handle update & insert seperately which technically still works as individual processes but the actual parts that we want to start using is:InsertOrUpdateAndGetId We have tried a few routes of processing it but in the end even on a blank table that only needs to insert data it still fails.

This is the error we are getting when any inser/update function is processed without results existing already:

Abp.Domain.Uow.AbpDbConcurrencyException (DESKTOP-J0MPMEA:18476) The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.

Abp.Domain.Uow.AbpDbConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. ---> Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.

The data does not get modified or removed as the table is still empty and the list of information is already fixed and is not altered during the add process.

We have tried process the data as below(most basic data model):

var id =_businessPartnerMasterData.InsertOrUpdateAndGetId(new BusinessPartnerMasterData() { Id = Convert.ToString(reader.GetValue("CardCode")), CardCode = Convert.ToString(reader.GetValue("CardCode")), CardName = Convert.ToString(reader.GetValue("CardName")), IsActive = Convert.ToString(reader.GetValue("validFor")) == "Y" ? true : false });

the same structure wrapped in a unit of work etc.

Could you please assist with how to correctly InsertOrUpdateAndGetId data with a hangfire process?

Please let me know if more info is required, but in general the above is what I get in error form once the process is "completed/failed".

Hi @ismcagdas,

Please see below:

using Abp.BackgroundJobs; using Abp.Dependency; using Abp.Domain.Repositories; using Abp.Domain.Uow; using Abp.EntityFrameworkCore; using Abp.Runtime.Session; using BRM.Configuration; using BRM.MultiTenancy; using BRM.MultiTenancy.Dto; using BRM.Web.Startup.Hangfire.Helpers; using Hangfire; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Sap.Data.Hana; using System.Collections.Generic; using System.Data; using System.Linq.Dynamic.Core; using System.Linq; using BRM.SystemSetup; using BRM.InventoryManagement; using System; using System.Transactions;

namespace BRM.Web.Startup.Hangfire.DataSyncs.Inbound { public class StockMasterDataInboundSync : BackgroundJob<int>, ITransientDependency { private readonly IRepository<Tenant, int> _tenantAppService; private readonly IRepository<QueryManager, long> _queryManager; private readonly IRepository<StockMasterData, string> _stockMasterData; private DataConnections _dataConnections; private IDbContextProvider<AbpDbContext> _Context; public IAbpSession _abpSession; private QueryHelpers _qH; private HanaConnection hanaConnection;

    private readonly IConfigurationRoot _appConfiguration;
    private readonly IWebHostEnvironment _hostingEnvironment;

    public StockMasterDataInboundSync(
        IWebHostEnvironment env,
        IDbContextProvider&lt;AbpDbContext&gt; Context,
        IAbpSession abpSession,
        IRepository&lt;Tenant, int&gt; tenantAppService,
        DataConnections dataConnections,
        IRepository&lt;QueryManager, long&gt; queryManager,
        IRepository&lt;StockMasterData, string&gt; stockMasterData)
    {
        _hostingEnvironment = env;
        _appConfiguration = env.GetAppConfiguration();
        _abpSession = abpSession;
        _Context = Context;
        _tenantAppService = tenantAppService;
        _dataConnections = dataConnections;
        _queryManager = queryManager;
        _stockMasterData = stockMasterData;
        hanaConnection = _dataConnections.GetHanaConnectionInstance
         (
             _appConfiguration.GetValue&lt;string&gt;("SAPHanaODBCConnectionDetail:Server"),
             _appConfiguration.GetValue&lt;string&gt;("SAPHanaODBCConnectionDetail:UserName"),
             _appConfiguration.GetValue&lt;string&gt;("SAPHanaODBCConnectionDetail:Password")
         );

    }



    [DisableConcurrentExecution(timeoutInSeconds: 10 * 60)]
    [AutomaticRetry(Attempts = 0)]
    [UnitOfWork]
    public override void Execute(int number)
    {
        
        //updated this from the standard (UnitOfWorkManager.Begin()) due to a post on here
            using (var unitOfWork = UnitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
            {
                var queryString = _queryManager.Single(x => x.QueryName == "GetDaily_OITM").QueryString;

                hanaConnection.Open();
                HanaDataReader reader = null;
                HanaCommand data = new HanaCommand(queryString, hanaConnection);
                reader = data.ExecuteReader();

                if (reader != null)
                {
                    while (reader.Read())
                    {
                     
                     
                            //_stockMasterData.InsertOrUpdateAndGetId(new StockMasterData()
                            _stockMasterData.InsertOrUpdate(new StockMasterData()
                            {
                                Id = Convert.ToString(reader.GetValue("ItemCode")),
                                ItemCode = Convert.ToString(reader.GetValue("ItemCode")),
                                ItemName = Convert.ToString(reader.GetValue("ItemName")),
                                IsActive = Convert.ToString(reader.GetValue("validFor")) == "Y" ? true : false
                            });
                       

                    }

                    reader.Close();
                }
                //this area has been modified several times with varying completion/save segments.
                UnitOfWorkManager.Current.SaveChanges();
                unitOfWork.Complete();
                //UnitOfWorkManager.Current.SaveChangesAsync().Wait();
                //unitOfWork.CompleteAsync().Wait();
            }
       
    }


}

}

Hi Ismcagdas,

I've tried the above and it still results in the same issue.

Updated code:

public async Task DailySync()
        {
            try
            {
                //using (var unitOfWork = UnitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
                //{
                    var queryString = _queryManager.Single(x => x.QueryName == "GetDaily_OCRD").QueryString;

                    hanaConnection.Open();
                    HanaDataReader reader = null;
                    HanaCommand data = new HanaCommand(queryString, hanaConnection);
                    reader = data.ExecuteReader();
                    List<BusinessPartnerMasterData> existingDataList = new List<BusinessPartnerMasterData>();
                    existingDataList = _businessPartnerMasterData.GetAll().ToList();


                    if (reader != null)
                    {
                        while (reader.Read())
                        {

                            bool isNew = false;
                            BusinessPartnerMasterData existingData = existingDataList.Where(x => x.Id == Convert.ToString(reader.GetValue("CardCode"))).FirstOrDefault();
                            if (existingData == null)
                            {
                                existingData = new BusinessPartnerMasterData();
                                isNew = true;
                            }

                            existingData.Id = Convert.ToString(reader.GetValue("CardCode"));
                            existingData.BusinessPartnerTypeId = Convert.ToString(reader.GetValue("CardType"));
                            existingData.CardCode = Convert.ToString(reader.GetValue("CardCode"));
                            existingData.CardName = Convert.ToString(reader.GetValue("CardName"));
                            existingData.IsActive = Convert.ToString(reader.GetValue("validFor")) == "Y" ? true : false;

                        await _businessPartnerMasterData.InsertOrUpdateAndGetIdAsync(existingData);

                        //    await _businessPartnerMasterData.InsertAsync(existingData);
                        //if (isNew)
                        //    await _businessPartnerMasterData.InsertAsync(existingData);
                        //else
                        //    await _businessPartnerMasterData.UpdateAsync(existingData);
                    }


                }

                //    await UnitOfWorkManager.Current.SaveChangesAsync();
                //    await unitOfWork.CompleteAsync();
                //}
            }
            catch (System.Exception ex)
            {

                //TODO: Notification logic (TBC)
            }
        }

100% will send a sample project with the issue to [email protected]

Had the same issue. Downgrading swagger in web.core to 6.2.3 helps currently.

Some possible Related information on this: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/2368 https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/2373

Not sure if there is a negative effect with downgrading currently.

Showing 61 to 70 of 76 entries