Developer forum

Forum » Integration » Data Integration activity failing with Item Provider destination and large XML file

Data Integration activity failing with Item Provider destination and large XML file

Dynamicweb Employee
Brian Zawistowski
Reply

Hello,

I have a Data Integration activity that fails with the error below when the imported XML file is large ( > 10 Mb).  Breaking the file into smaller parts allows the activity to complete successfully, however, because the destination provider is set to "Remove missing items after import", running multiple imports simply deletes the previous data.  Is there a way to set the timeout for the import activity longer to avoid this error?

 

Job Failed with the following message: The operation is not valid for the state of the transaction.

at System.Transactions.TransactionState.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType) at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType) at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification) at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx) at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction) at System.Data.ProviderBase.DbConnectionPool.PrepareConnection(DbConnection owningObject, DbConnectionInternal obj, Transaction transaction) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection() at Dynamicweb.Data.Database.ExecuteScalar(CommandBuilder commandBuilder, IDbConnection connection) at Dynamicweb.Data.GeneralLogRepository.SaveEvent(LogEvent logEvent) at Dynamicweb.Logging.LogEvents.LogEventService.SaveEvent(LogEvent logEvent) at Dynamicweb.Logging.LoggerBase.Log(LogLevel level, String message, Exception ex) at Dynamicweb.Data.Database.ExecuteNonQuery(IDbCommand command) at Dynamicweb.Data.Database.ExecuteNonQuery(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout) at Dynamicweb.Data.Database.ExecuteNonQuery(CommandBuilder commandBuilder, IDbConnection connection, Boolean useTransaction, Int32 commandTimeout) at Dynamicweb.Data.Database.ExecuteNonQuery(CommandBuilder commandBuilder, Boolean useTransaction, Int32 commandTimeout) at Dynamicweb.Content.Items.ItemList.DeleteRelation(Int32 itemListId, String itemId, Boolean deleteItem, String itemType) at Dynamicweb.DataIntegration.Providers.ItemDestinationWriter.DeleteAssociatedWithMissedItems(String itemType, List`1 itemIDsToRemove) at Dynamicweb.DataIntegration.Providers.ItemDestinationWriter.DeleteMissingItems(Boolean deleteAssociatedWithMissedItems) at Dynamicweb.DataIntegration.Providers.ItemProvider.ItemProvider.RunJob(Job job)


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Brian,

it looks like you have a lot of Item relations lists data in the database, could you try to increase the database command timeout by changing the value in the global settings path:
/GlobalSettings/System/Database/CommandTimeout? 
The max allowed value there is 240 (which is in seconds).
Kind regards, Dmitrij

 
Dynamicweb Employee
Brian Zawistowski
Reply

Hi Dmitriy,

Thanks for the suggestion.  I changed the CommandTimeout to 240 and restarted the site.  I reran the Data Integration activity, and it failed with the same error.  Here is the contents of the log file:

2021-02-24 10:47:56.574: Starting job - BL Import Publications 2.
2021-02-24 10:48:00.239: Start checking input files changing
2021-02-24 10:48:05.248: Finish checking input files changing
2021-02-24 10:48:05.248: reading configuration
2021-02-24 10:48:05.575: Starting reading item type Publications.
2021-02-24 10:48:07.275: Finished reading item type Publications.
2021-02-24 11:32:07.957: Starting import item type Publications
2021-02-24 11:32:07.997: Job Failed with the following message: The operation is not valid for the state of the transaction.
   at System.Transactions.TransactionState.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)    at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType)    at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification)    at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)    at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)    at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)    at System.Data.ProviderBase.DbConnectionPool.PrepareConnection(DbConnection owningObject, DbConnectionInternal obj, Transaction transaction)    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)    at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)    at System.Data.SqlClient.SqlConnection.Open()    at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection(Boolean open)    at Dynamicweb.Data.Database.CreateConnection()    at Dynamicweb.Content.Items.Queries.Repository.Update(IEnumerable`1 items, ItemContext context, Boolean synchronizePages)    at Dynamicweb.DataIntegration.Providers.ItemDestinationWriter.UpdateItems(String itemType, List`1 items)    at Dynamicweb.DataIntegration.Providers.ItemDestinationWriter.ImportItems()    at Dynamicweb.DataIntegration.Providers.ItemProvider.ItemProvider.RunJob(Job job)
2021-02-24 11:32:08.017: Job failed.
2021-02-24 11:32:08.017: Finished job - BL Import Publications 2.
2021-02-24 11:32:08.032: Batch failed.

I should also mention that this was working previous to upgrading from Dynamicweb version 8 to 9.9.7

Thanks

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Brian,
the error is the same but the stack trace shows a bit different and  now it failed even before it has got till the DeleteMissing, since UpdateItems method is called first and now it has
failed there. Can you try to go to your .Net folder and edit the machine.config file and add the following to the end of the configuration section.  That is, right before the </configuration> closing tag:

<configuration>
<system.transactions>

   <machineSettings maxTimeout="02:00:00" />

</system.transactions> 
</configuration>

It looks like some stuff in the Items api has changed since Dynamicweb 8.

Kind regards, Dmitrij

 
Dynamicweb Employee
Brian Zawistowski
Reply

Hi Dmitriy,

That worked!  The Data Integration activity was able to complete.  I will let the customer do some more testing but that seems to be the answer.

Thanks for your help!

 
Dynamicweb Employee
Brian Zawistowski
Reply

Hi Dmitriy,

Do you have any idea what the upper size limit will be for processing a file of this type?  Will this process stop working if the customer's import file continues to grow?

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Brian,
I have no idea, it is an Items api that causes the problems, so I do not have any clue what could be a limit for that.
Currently the process of updating the Items splits them into a chunks of 1000 and process them one by one in one transaction scope,
so it should work until the database query or trasaction timeout allows.
Kind regards, Dmitrij

 

You must be logged in to post in the forum