Base solution for your next web application

Activities of "diego"

Hi all, i have some issue and questions about background jobs.

First of all my version of Abp framework is 0.9.1.1, i use it with asp.net zero version 1.10.1

Questions:

  • There is a way to schedule a single execution for a job on default background job manager? I don't want the manager retry execution on fail. The job success or fail, no retry
  • On default background job manager what is the maximum try count? I don't want to wait 2 days for timeout
  • My website is hosted on azure web site, currently run on 2 instances. Concurrency for jobs work fine in this scenario?
  • In multi-instance scenario, is possible to know what instance has performed the job?

Issue:

  • My job fail reporting this error: Timeout expired. I have a UnitOfWork with 30 minutes timeout , the job fail after 1 minute or less. Any suggestion? I think this is a bug After deep testing i see that first exection of the job fail, usually the second work fine. I think is related to the environment (2 instance on azure) but i'm not sure
  • The job execution history are saved to database?

Thanks in advance, Diego

Hi all, i'm looking for extending notification system. My idea is to manage multiple notification type (mail, in app, push notifications, bot notification) like actual notification system. I don't want to duplicate/triplicate DB tables and entities then i think the correct approach is to extend the actual tables and classes with the concept of NotificationType or NotificationChannel (It 's always difficult to choose the correct name :lol: )

By this way i can generalize notification management both on DAL layer and Business layer. Obviously the notification dispatch require a specific implementation, one for each notification type.

What do you think about that?

Have a nice day, Diego

Hi ismcagdas, i think you are right

Unfortunatly i use web app on Azure and seems which is not possible to set timeout on load balancer (default 4 minute). I don't agree and understand this restriction, the only way for me is to change approach.

Thank you for suggestion, really useful

Hi all, i need help about strange timeout error, below details:

1 - I have a application service with a long running method that execute a massive import

[AbpAuthorize(AppPermissions.Pages_Projects_AllProjects)]
        [UnitOfWork(IsDisabled = true)]
        public virtual async Task<DataImporterListResultDto<ProjectImportDto>> ImportProjects(FileDto fileDto)
        {
			....
			....
			....

			// Start saving element to database
			foreach (ProjectImportDto item in dto.ImportedList.Where(i => i.IsValid))
			{
				try
				{
					using (var unitOfWork = _unitOfWorkManager.Begin(new UnitOfWorkOptions
					{
						IsolationLevel = IsolationLevel.ReadCommitted,
						IsTransactional = true,
						Timeout = TimeSpan.FromMinutes(30)
					}))
					{
						bool saved = await saveProject(dto, item, excludeAttachments);
						if (!saved)
						{
							dto.AddWarningMessage(String.Format(L("ImportSaveProjectFailed"), item.LegacyId));
							Logger.Warn(string.Format(L("ImportSaveProjectFailed"), item.LegacyId));
							throw new Exception(String.Format(L("ImportSaveProjectFailed"), item.LegacyId));
						}
						else
						{
							unitOfWork.Complete();
							dto.TotalImportedRecords++;
						}
					}

				}
				catch (Exception ex)
				{
					Logger.Error(ex.Message);
				}
			
			....
			....
        }

As you can see the UnitOfWork is created with 30 minutes timeout

2 - I use DynamicWebApi in standard mode to expose the application service

//Automatically creates Web API controllers for all application services of the application
            DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(ImproveApplicationModule).Assembly, "app")
                .Build();

3 - My site is AngularJs SPA website, ORM is EntityFramewrok and the database server is SQL Server 2012

4 - Client side the application service is called in that way:

projectService.importProjects({
			fileName: vm.fileToImport.fileName,
			fileType: vm.fileToImport.fileType,
			fileToken: vm.fileToImport.fileToken,
		}, { timeout: 600000 }).success(function (result) {
			vm.importResult = result;
		}).error(function () {
			abp.notify.error(app.localize('WronglyImported'));
		}).finally(function () {
			vm.loading = false;
		});

Note the extra-timeout on ajax call


The problem: All work fine in dev-env with visual studio, fails sistematically on Azure after 4 minutes execution The returned error is: "500 - The request timed out. The web server failed to respond within the specified time"

I have tried to set timeout on web.config in the "httpruntime" section and also in the "system.webservice/security" section whithout success. I also tried to update Abp.* packages to latest version but without improvements. With DynamicWebApi i can't decorate method with specific timeout attribute, any suggestions to resolve the issue?

Thanks in advance, Diego

Question

Hello, i have few questions about entities design, suppose we have these 2 classes

public class Partner : FullAuditedEntity, IPassivable, IMayHaveTenant
{
	public const int MaxNameLength = 100;

	[Required]
	[StringLength(MaxNameLength)]
	public virtual string Name { get; set; }

	[Required]
	public virtual PartnerType PartnerType { get; set; }		
	
	public virtual int? TenantId { get; set; }
	public virtual bool IsActive { get; set; }	
	
}

public class PartnerType : Entity, IPassivable, IMayHaveTenant
{
        public const int MaxNameLength = 100;

        [Required]
        [StringLength(MaxNameLength)]
        public virtual string Name { get; set; }

        public virtual int? TenantId { get; set; }
        public virtual bool IsActive { get; set; }	
}

1 - It's right use the [Required] attribute on the PartnerType property of the Partner class? 2 - Whenever there is a relation between class, i must use the ForeignKey attributes? 3 - With the [Required] attribute on the PartnerType property of the Partner class i have a issue trying deleting a Partner, below the code

public async Task DeletePartner(IdInput input)
{	
	await _partnersRepository.DeleteAsync(input.Id);
}

The delete (indeed soft delete) fail reporting this validation error: "The PartnerType field is required". Why?

Thanks in advance, Diego

Showing 1 to 5 of 5 entries