Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicolas 4 posts 35 karma points
    May 18, 2015 @ 23:14
    Nicolas
    0

    ContentService scenario

    Good evening

    We currently have an umbraco(7.2.1) website where members can create 'orders' (node). In these orders they then can add 'orderlines'(child-nodes) that contain both a 'product' (contentpicker) and a 'quantity'(textfield). Some orders contain 100+ orderlines.

    So when a user saves an order it creates a node 'order' with children 'orderlines'. This is the code:

                    //create new order
                    orderContent = cart.UpdateModel(customerId, cartName);
                    contentService.Save(orderContent);
    
                    //add orderlines (product + qty)
                    foreach (var cartLine in cart.CartLines)
                    {
                        var orderLine = cartLine.UpdateModel(orderContent.Id);
                        contentService.Save(orderLine);
                    }
    
                    contentService.PublishWithChildrenWithStatus(orderContent, 0, true);
    

    The UpdateModel functions create an IContent object and fill in the properties.

    Question 1: When a user saves an order this can take up to 0.9s per orderLine to be created and saved, and then it takes some time to publish the order and its children. Is this actually normal?

    Question 2: When a user creates an order, whilst another order is still being made (by another user) does this mean that this users order is only starting to being created when the previous order is finished saving + publishing, with the contentService being singleton?

    Question 3: Have we made a design mistake by storing these orders in Umbraco itself, and not in an other database (that we can reach via an ORM)?

    We are kind of new to creating 'bigger' applications with Umbraco, so any help would be greatly appreciated.

Please Sign in or register to post replies

Write your reply to:

Draft