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()
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.
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