November Happy Hour will be moved to Thursday December 5th.

Exception when Imports one or many catalogs, metadata and dictionaries from an xml source

Vote:
 

Hi,

I am using CatalogImportExport class to import catalogs, metadata and dictionaries from an xml source to episerver commerce and sometime it work but sometime it throw an exception like below

Could you please give me a hand

My code

using (var catalogXmlStream = new MemoryStream())
{
catalogXDoc.Save(catalogXmlStream);
// set stream pointer to beginning
catalogXmlStream.Seek(0, SeekOrigin.Begin);

// import back by episerver import export
CatalogImportExport cie = new CatalogImportExport();
cie.Import(catalogXmlStream, true);
}

The job is running. - Starting execution of: Plus.Web.Business.ScheduleTasks.NewScheduledJob.APIServiceENEGScheduledJob
Invalid operation. The connection is closed.
<br>
at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
at System.Data.SqlClient.SqlInternalTransaction.Rollback()
at System.Data.SqlClient.SqlTransaction.Rollback()
at Mediachase.Data.Provider.TransactionScope.ThreadStaticTransactionScope.Dispose()
at Mediachase.Data.Provider.TransactionScope.Dispose(Boolean disposing)
at Mediachase.Data.Provider.TransactionScope.Dispose()
at Mediachase.MetaDataPlus.Internal.CatalogMetaObjectRepository.UpdateBatch(IDictionary`2 metaObjectsByLanguage)
at Mediachase.Commerce.Catalog.ImportExport.Import.MetaDataReader.AcceptChanges(Dictionary`2 metaObjects)
at Mediachase.Commerce.Catalog.ImportExport.Import.NodesReader.Read(ImportCatalogNodeCache relationCache)
at Mediachase.Commerce.Catalog.ImportExport.Import.Importer.Import(Stream stream, String sourceDirectory, Boolean overwrite)
at Electrolux.Core.Catalog.Import.EdenImportService.Import(String language, IEdenCatalogConfigs catalogConfigs, IEdenMappingConfigs mappingConfigs, IEdenURLBasePathConfigs urlBasePathConfigs, XmlNode node)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Electrolux.Core.Catalog.Import.EdenImportService.Import(String language, IEdenCatalogConfigs catalogConfigs, IEdenMappingConfigs mappingConfigs, IEdenURLBasePathConfigs urlBasePathConfigs, XmlNode node)
at Electrolux.Web.Business.ScheduleTasks.NewScheduledJob.NewEDENAPIServiceScheduledJobBase.Execute()

Thanks

Thao Pham

#202472
Mar 27, 2019 9:20
Vote:
 

Because this is a "sometimes" error, it might have something to do with your environment/site implementation/catalog. I'd suggest you to go to developer support service for further assistance. 

#202478
Mar 27, 2019 10:32
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.