简体   繁体   中英

stop loading data after 15 min c#

I am writing an website where I get some data from the database. When starting the website on my computer I get the data for 15 min. After these 15 min the files don't load anymore.

在此处输入图片说明

When I restart the backend (Visual Studio C#) then it happens the same.

Controller from the file:

[UnitOfWorkActionFilter]
[RoutePrefix("categories")]
public class CategoriesController : ApiController {
    private ICategoriesProcessor _categoriesProcessor;
    private IPagedDataRequestFactory _pagedDataRequestFactory;
    public CategoriesController(ICategoriesProcessor categoriesProcessor, IPagedDataRequestFactory pagedDataRequestFactory) {
        _pagedDataRequestFactory = pagedDataRequestFactory;
        _categoriesProcessor = categoriesProcessor;
    }

    [Route()]
    [HttpGet]
    public PagedResponse<Category> GetCategories(HttpRequestMessage requestMessage) {
        var request = _pagedDataRequestFactory.Create(requestMessage.RequestUri);
        return _categoriesProcessor.GetCategories(request);
    }
}

here is the code from the UnitWorkActionFilterAttribute

 public class UnitOfWorkActionFilterAttribute : ActionFilterAttribute {
    public virtual IActionTransactionHelper ActionTransactionHelper { get { return WebContainerManager.Get<IActionTransactionHelper>(); } }
    public override bool AllowMultiple { get { return false; } }
    public override void OnActionExecuting(HttpActionContext actionContext) {
        ActionTransactionHelper.BeginTransaction();
    }
    public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) {
        ActionTransactionHelper.EndTransaction(actionExecutedContext);
        ActionTransactionHelper.CloseSession();
    }
}

I found out that the problem is, that the Session opens but not close but I don't know how to fix it.

Does someone has an idea why it's not working?

have you try access from Fiddler ??? what the client you used to call your API... see what the fiddler got message, and if you call the API, that is call that Method API or not...need detail information, this error have come to method or just in client stuff...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM