Base solution for your next web application

Activities of "leonkosak"

Question

I have a little specific update scenario. In database table, we have to update entity - just one property. But the problem is that each record has relatively large binary object (varbinary - few megabytes at least). There is issue in Azure environment when only one property of such entity has to be updated but we always get error when calling _repository.GetById(id). (There is no issue if we read this binary object inside entity, write it to temp folder location so that client application gets FileDto object to download it).

How can we implement such update scenario? Thank you for suggestions.

Situation: There is varbinary column in database table and inserting (uploading file) is really fast (9MB), but when reading only one record, the response is very slow. There is aprox. 9MB file in varbinary column but it takes 60-70 seconds in our local environment that postman returns response. in AuditLogs, the time is aprox. 6-7 seconds (which is still a lot).

I donn't know why there is so much difference between ecetution time in AuditLogs table and in reality. I cannot explain either why inserting is so much faster.

AppService


[HttpGet]
        public async Task<MobileReleaseListDto> GetMobileRelease(int versionCode = 0)
        {
            //var release = from mr in _mobileReleaseRepository.GetAll()
            //              where mr.VersionCode > versionCode && mr.Active
            //              orderby mr.VersionCode descending
            //              select mr;
            var release = _mobileReleaseRepository.GetAll()
                .Where(x => x.VersionCode > versionCode && x.Active)
                .OrderByDescending(x => x.VersionCode);
            var lastFile = await release.FirstOrDefaultAsync();
            if (lastFile != null)
            {
                return ObjectMapper.Map<MobileReleaseListDto>(lastFile);
            }
            else
                return new MobileReleaseListDto();
        }

Database table:


[Table("tMobileRelease")]
    public class MobileReleaseModel : Entity
    {
        public const int MaxVersionNameLength = 8;

        [Required]
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public override int Id { get; set; }

        public int VersionCode { get; set; }

        [StringLength(MaxVersionNameLength)]
        public string VersionName { get; set; }

        public string File { get; set; }

        public bool Active { get; set; }

        public int? TenantId { get; set; }

        public byte[] Bytes { get; set; }
    }

Our local environment is pretty powerful and that is not the problem. In Azure, we cannot get response after 500+ seconds.

Thank you for suggestions.

One of our customers have multitenant solution with each tenant in separated database. We are now in transition from local environment to Azure (our Azure envoronment vith our host database). The only problem is, that users cannot login in tenant because ASP.NET Zero cannot authenticate (Login failed error). I can see logs (AbpAuditLogs table) in each tenant database (for login failed), so the database for tenant is resolved correctly in Azure environment. I tried to set correct new TenantId in each table (because we just move tenant databases in existing environment in Azure and not host database in local environment).

We tried to update all TenantId values in tenant databases, but it does not help.

What can we do now? What steps are required to move tenant database to other environment.

Thank you for suggestions.

Showing 11 to 13 of 13 entries