SUGGESTION: Increase the command timeout for language import

10 years ago
Since the language packs are getting larger, the command timeout to import them into the database should be increased from the default of 30 seconds. This will reduce the likelihood of getting the following error message (and corresponding SqlException) when importing a language pack: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.".

File: Libraries\Nop.DataAccess.SqlServer\Localization\SQLLocaleStringResourceProvider.cs
(insert the following at line #213 in method InsertAllLocaleStringResourcesFromXML()).
dbCommand.CommandTimeout = 300; // Allows five minutes for the import


This refers to version 1.50.

.
10 years ago
Thanks for suggestion. Already did for upcoming release (1.60)
10 years ago
yes, this bit me too. thanks!
10 years ago
nopCommerce team | a.m. wrote:
Thanks for suggestion. Already did for upcoming release (1.60)


I'm still getting timeout in 1.7 when I try to import (swedish language) xml file.
10 years ago
as far as I know, when I import a Language Pack file locally on my laptop it last arround 2 minutes.
The code is designed to TimeOut after 5 minutes (600 sec).

See that in the file : Nop.BusinessLogic/Localization/LocaleStringResourceManager.cs

        public static void InsertAllLocaleStringResourcesFromXml(int languageId, string xml)
        {
            var context = ObjectContextHelper.CurrentObjectContext;
            //long-running query
            int? timeout = context.CommandTimeout;
            try
            {
                context.CommandTimeout = 600; // <== HERE
                context.Sp_LanguagePackImport(languageId, xml);
            }
            catch (Exception exc)
            {
                throw;
            }
            finally
            {
                context.CommandTimeout = timeout;
            }
     ...


Maybe you are above the limit with your platform. I suggest you change this setting to 1200 and re-compile the solution.

Anyone else is experimenting this ?

Erwan de Cadoudal
9 years ago
I still have the same problem ... timeout ... french language pack for 1.90 version running on Arvixe servers, therefore remote ... thinking of going the XML import directly into the database ...
9 years ago
Splitting the file into 5 files did the job !