0
Fixed

Parameter limit issue when updating multiple containers

Matthew Clark 12 years ago updated by anonymous 8 years ago 8

The following error is thrown when a large number of containers are being updated:

An exception has occured whilst performing a job for adapter d5251d7d-05cc-4d35-916e-e99e06b9ffd3 job UpdateGetAllEntitiesContainers:
The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.

This was found while configured SALES-230. Within a composite, I have an address and person connector. The address DNs are set up such that they are contained by the person object (eg. person CN=100001 with address CN=H,CN=100001). If the person objects are cleared and reimported, the attempt to update all the containers fails with the above error.

Tony, could this be similar to IDB-451?

Matt has additionally mentioned that there are 3000 containers in the DB.

From the message it looks like this is happening in UpdateGetAllEntitiesContainers, of which there is only one method in the ContainerContextHandlerBase.

This is dependant on the HashSet passed in, which is dependant on the HashSet passed in from SubmitContainerTask, and in both usages the containers passed in are in bulk - they should be paged.

I have made the container context behave in a similar manner to the entity context, in that it inserts to a dataset and then uses sql bulk copy to perform the insert.

Please let me know if it fixes your issue.

Thanks.

Tony, as part of IDB-451 you said you were able to confirm the resolution of the issue. Did your confirmation include something that would also confirm the resolution of this behaviour?

I'm still seeing this in test1 with 10k entities changed.

Full exception:

    
An exception has occured whilst performing a job for adapter 2656b225-d789-437d-bd32-03ae2f6ed07c job UpdateGetAllEntitiesContainers:
System.Data.SqlClient.SqlException (0x80131904): The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at Unify.Framework.Collections.EnumerableExtensions.<ProduceAutoPages>d__a`1.MoveNext()
at Unify.Framework.Data.LinqContextConversionBase`4.DeleteItems(HashSet`1 deletedItems, TContext sourceContext, SqlConnection connection)
at Unify.Framework.Data.LinqContextConversionBase`4.SubmitChanges()
at Unify.Framework.Data.LinqContextConversionBase`4.SubmitChanges()
at Unify.Product.IdentityBroker.GetAllEntitiesContainerHandler.UpdateGetAllEntitiesContainers.SubmitContainersTask(HashSet`1 containers, IContainerContext context)
at Unify.Product.IdentityBroker.ContainerContextHandlerBase.SubmitContainersJobBase.RunBase()
at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)

I've added a #ContainerSelect temp table to the delete statement.

Assigned to Matthew to test.

I have confirmed this for the mentioned scenario of clearing the connector, performing a full import, repopulating the connector (reintroducing the containers), and performing another full import. This was for more than 3000 items, and no errors were encountered. Issue closed