I am working on E-Commerce system (NopCommerce).Technology I am using is Asp.Net Mvc3
and sql server 2008
While placing order Exception is thrown (Not every time but when there is load on database)
After adding Product to order I use following function to update Inventory
_productService.AdjustInventory(sc.ProductVariant, true, sc.Quantity, sc.AttributesXml);
Error while placing order. Error 0: Error: An error occurred while updating the entries. See the inner exception for details.. Full exception: System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
There might be case that many customers are online or I am updating ProductVariant which is lengthy process(takes 10-12 mins). At that time only this exception is thrown.
Any solutions to avoid this exception.