0
Fixed

Null reference in relational composite key transformation when a key value doesn't exist

Matthew Clark 12 years ago updated by anonymous 9 years ago 4

When using a relational composite key transformation on a field that doesn't always exist, a null reference exception is thrown:

Adapter import all entities for adapter failed.
Adapter import all entities for adapter 766401c6-e6e8-46d8-8c10-df86fbde0988 failed with reason Value cannot be null.
Parameter name: item. Duration: 00:00:04.5265410
Error details:
System.ArgumentNullException: Value cannot be null.
Parameter name: item
at Unify.Product.IdentityBroker.Repository.EntityLinqQueryExecutorInformation`1.AddValue(Guid searchGuid, TEntityKey keyValue, IValue item, Int32 columnSequence, Int32 valueSequence, IEntityCollectionKeyUtility`1 collectionKeyUtility)
at Unify.Product.IdentityBroker.Repository.EntityExpressionQueryVisitor`4.<>c_DisplayClass19.<>cDisplayClass1b.<CreateMultiValueRangeExpression>b_16(MultiKeyValue itemValue, Int32 itemValueIndex)
at Unify.Framework.Visitor.VisitT(IEnumerable`1 visitCollection, Action`2 visitor)
at Unify.Framework.Visitor.VisitT(IEnumerable`1 visitCollection, Action`2 visitor)
at Unify.Product.IdentityBroker.Repository.EntityExpressionQueryVisitor`4.CreateMultiValueRangeExpression(IMultiKey`1 multiKey, IEnumerable`1 sourceValueList, IQueryable`1 sourceQueryable)
at Unify.Product.IdentityBroker.Repository.VisitMethodWhereWithMultiValueEnumerableContains`4.Transform(MethodCallExpression expression)
at Unify.Product.IdentityBroker.Repository.EntityExpressionQueryVisitor`4.VisitMethodCall(MethodCallExpression m)
at Unify.Framework.ExpressionVisitorBase`11.Visit(Expression exp)
at Unify.Framework.Data.LinqContextConversionExpressionVisitorBase`5.ConvertExpression(Expression partitionExpression)
at Unify.Framework.Data.LinqQueryConversionProvider`5.GetOrderedQuery(Expression businessExpression, IQueryable`1 sourceQueryable, TContext sourceContext)
at Unify.Framework.Data.LinqWhereQuery`5.GetEnumerator()
at System.Linq.Lookup`2.CreateTSource(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at Unify.Product.IdentityBroker.EntityCompositeKeyDistinguishedNameStaticRelationValueAdapterBase.Transform(IEnumerable`1 sourceValue)
at System.Linq.Enumerable.AggregateTSource,TAccumulate(IEnumerable`1 source, TAccumulate seed, Func`3 func)
at System.Linq.Enumerable.<>c_DisplayClass12`3.<CombineSelectors>b_11(TSource x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Unify.Framework.Collections.EnumerableExtensions.<ActionOnLast>d__17`1.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at Unify.Framework.Collections.EnumerableExtensions.<ActionOnLast>d__17`1.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Unify.Framework.Collections.ActionOnExceptionEnumerator`1.MoveNext()
at Unify.Framework.Collections.EnumerableExtensions.<ActionOnLast>d__17`1.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
at Unify.Framework.IO.LDIFComponentFileGenerator`1.GenerateFile(TextWriter writer, IEnumerable`1 entries)
at Unify.Product.IdentityBroker.LDIFAdapterBase.<>c_DisplayClass14`1.<CreateLDIFComponentStream>b_13(Stream stream)
at Unify.Framework.IO.LazyEvaluationStream.Evaluate(Object obj)

See attached configuration. The key fields are not always populated as a date relational transformation means position information is not populated for some users. Earlier tests of this transformation have succeeded with key fields from a connector, rather than further down the chain.


Unify.Product.IdentityBroker.AdapterEnginePlugInKey.extensibility.config.xml
Unify.Product.IdentityBroker.ConnectorEnginePlugInKey.extensibility.config.xml

Fixed and confirmed working locally by updating the null checks in the transformation. This is as a workaround to how the expression visitor is currently behaving. We will need to confirm this with the next build of the service.

Confirmed in latest service build. Closed.

Reopening for the logging of time

Closed following logging of time