- Home
- LLBLGen Pro
- Bugs & Issues
LINQ group after select issue
Joined: 11-Mar-2009
Hi!
I wanted to perform a pre-selection of data, and then use the selection, in particular for grouping.
Using a data access adapter da:
LinqMetaData metaData = new LinqMetaData(da);
var selection = from t in metaData.Text
select t;
var groups = from s in selection
group s by s.Category into g
select g.Key;
foreach (var v in groups)
{
//do something
}
I get the following exception:
A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>TestGoupLinq.vshost.exe</AppDomain><Exception><ExceptionType>SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException, SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27</ExceptionType><Message>An exception was caught during the execution of a retrieval query: ERROR: 42703: column LPA_L1.Category does not exist. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.</Message><StackTrace> at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchDataReader(IRetrievalQuery queryToExecute, CommandBehavior readerBehavior)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchProjection(List`1 valueProjectors, IGeneralDataProjector projector, IRetrievalQuery queryToExecute, Dictionary`2 typeConvertersToRun)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchProjection(List`1 valueProjectors, IGeneralDataProjector projector, IEntityFields2 fields, IRelationPredicateBucket filter, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IGroupByCollection groupByClause, Boolean allowDuplicates, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProvider2.ExecuteValueListProjection(QueryExpression toExecute)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.ExecuteExpression(Expression handledExpression)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.Execute(Expression expression)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.System.Linq.IQueryProvider.Execute(Expression expression)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProQuery`1.Execute()
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProQuery`1.System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator()
at TestGoupLinq.Program.Main(String[] args) in C:\Users\cschenk\Desktop\TestGoupLinq\TestGoupLinq\Program.cs:line 30
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: ERROR: 42703: column LPA_L1.Category does not exist. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---&gt; Npgsql.NpgsqlException:
column LPA_L1.Category does not exist
Severity: ERROR
Code: 42703
at Npgsql.NpgsqlConnector.CheckErrors()
at Npgsql.NpgsqlConnector.CheckErrorsAndNotifications()
at Npgsql.NpgsqlCommand.ExecuteCommand()
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior cb)
at Npgsql.NpgsqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior cb)
at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
If I do instead:
var groups = from t in metaData.Text
group t by t.Category into g
select g.Key;
foreach (var v in groups)
{
//do something
}
It works fine. Hence, the pre-selection seems to be the cause the failure. Is it because it is considered a nested query and grouping operations are not allowed on nested queries, or something alike?
My config is: libs runtime version: orm 2.6.09.0327 / linq 2.6.09.0331 Adapter - .NET 3.5 - WCF service PostgreSQL 8.3 - lib 2.6.0407 from this post: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=15686
It might be related to the problem you received a fix for, earlier. We can't reproduce it on Sqlserver, as it's working properly (so it's not linq related).
Please post the generated SQL, perhaps it's another problem. Also please double-check that your service indeed uses the new DQE for postgres, which might not be the case (i.e. the old one is in the gac... etc.)
Joined: 11-Mar-2009
Hi Walaa,
I double-checked my assemblies. I think the application really references the proper, last ones, including the earlier fix for postgre Here is the SQL:
Generated Sql query:
Query: SELECT "LPA_L4"."ID" AS "F34_0", "LPA_L5"."ID" AS "F12_1", "LPA_L5"."STATUS" AS "F12_2", "LPA_L5"."DESCRIPTION" AS "F12_3", "LPA_L5"."ACCESSRULEACCESSRULE_ID_FK" AS "F12_4", "LPA_L5"."ARCHIVEMETARCHIVEMET_ID_FK" AS "F12_5", "LPA_L6"."ID" AS "F23_6", "LPA_L6"."ISPOTENTIAL" AS "F23_7", "LPA_L6"."INFORMATION_START" AS "F23_8", "LPA_L6"."INFORMATION_END" AS "F23_9", "LPA_L7"."ID" AS "F42_10", "LPA_L7"."CATEGORY" AS "F42_11", "LPA_L7"."TEXT" AS "F42_12" FROM ((( "switch_bg"."OBJECT" "LPA_L4" LEFT JOIN "switch_bg"."DATAOBJECT" "LPA_L5" ON "LPA_L4"."ID"="LPA_L5"."ID") LEFT JOIN "switch_bg"."INFORMATION" "LPA_L6" ON "LPA_L5"."ID"="LPA_L6"."ID") LEFT JOIN "switch_bg"."TEXT" "LPA_L7" ON "LPA_L6"."ID"="LPA_L7"."ID")
Method Exit: CreateSelectDQ
Method Exit: CreateSubQuery
Generated Sql query:
Query: SELECT "LPA_L3"."F42_11" FROM (SELECT "LPA_L4"."ID" AS "F34_0", "LPA_L5"."ID" AS "F12_1", "LPA_L5"."STATUS" AS "F12_2", "LPA_L5"."DESCRIPTION" AS "F12_3", "LPA_L5"."ACCESSRULEACCESSRULE_ID_FK" AS "F12_4", "LPA_L5"."ARCHIVEMETARCHIVEMET_ID_FK" AS "F12_5", "LPA_L6"."ID" AS "F23_6", "LPA_L6"."ISPOTENTIAL" AS "F23_7", "LPA_L6"."INFORMATION_START" AS "F23_8", "LPA_L6"."INFORMATION_END" AS "F23_9", "LPA_L7"."ID" AS "F42_10", "LPA_L7"."CATEGORY" AS "F42_11", "LPA_L7"."TEXT" AS "F42_12" FROM ((( "switch_bg"."OBJECT" "LPA_L4" LEFT JOIN "switch_bg"."DATAOBJECT" "LPA_L5" ON "LPA_L4"."ID"="LPA_L5"."ID") LEFT JOIN "switch_bg"."INFORMATION" "LPA_L6" ON "LPA_L5"."ID"="LPA_L6"."ID") LEFT JOIN "switch_bg"."TEXT" "LPA_L7" ON "LPA_L6"."ID"="LPA_L7"."ID")) "LPA_L3" GROUP BY "LPA_L3"."F42_11"
Method Exit: CreateSelectDQ
Method Exit: CreateSubQuery
Generated Sql query:
Query: SELECT "LPA_L1"."Category" FROM (SELECT "LPA_L3"."F42_11" FROM (SELECT "LPA_L4"."ID" AS "F34_0", "LPA_L5"."ID" AS "F12_1", "LPA_L5"."STATUS" AS "F12_2", "LPA_L5"."DESCRIPTION" AS "F12_3", "LPA_L5"."ACCESSRULEACCESSRULE_ID_FK" AS "F12_4", "LPA_L5"."ARCHIVEMETARCHIVEMET_ID_FK" AS "F12_5", "LPA_L6"."ID" AS "F23_6", "LPA_L6"."ISPOTENTIAL" AS "F23_7", "LPA_L6"."INFORMATION_START" AS "F23_8", "LPA_L6"."INFORMATION_END" AS "F23_9", "LPA_L7"."ID" AS "F42_10", "LPA_L7"."CATEGORY" AS "F42_11", "LPA_L7"."TEXT" AS "F42_12" FROM ((( "switch_bg"."OBJECT" "LPA_L4" LEFT JOIN "switch_bg"."DATAOBJECT" "LPA_L5" ON "LPA_L4"."ID"="LPA_L5"."ID") LEFT JOIN "switch_bg"."INFORMATION" "LPA_L6" ON "LPA_L5"."ID"="LPA_L6"."ID") LEFT JOIN "switch_bg"."TEXT" "LPA_L7" ON "LPA_L6"."ID"="LPA_L7"."ID")) "LPA_L3" GROUP BY "LPA_L3"."F42_11") "LPA_L1"
Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
Method Enter: DataAccessAdapterBase.OpenConnection
: Connection physically opened.
Method Exit: DataAccessAdapterBase.OpenConnection
A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll
Never mind, I reproduced it:
LinqMetaData metaData = new LinqMetaData(adapter);
var q1 = from c in metaData.Clerk
select c;
var q = from c in q1
group c by c.JobDescription into g
select g.Key;
Inheritance fields are re-aliased as you can see in the query. The field referring to these fields must take that into account. There is logic in place to take care of this, however apparently it isn't solid enough. Will look into it.
For now, please use the direct approach as you stated in your first post, we'll look into how to fix this properly so you can use query fragments and build a query from that even in inheritance scenarios.
Interestingly, this works:
var q1 = from c in metaData.Clerk
select c;
var q2 = from c in q1
select c;
var q = from c in q2
select c;
which gives:
SELECT DISTINCT [LPA_L1].[F7_0], [LPA_L1].[F7_1], [LPA_L1].[F7_2], [LPA_L1].[F7_3], [LPA_L1].[F4_4], [LPA_L1].[F4_5]
FROM
(
SELECT [LPA_L2].[F7_0], [LPA_L2].[F7_1], [LPA_L2].[F7_2], [LPA_L2].[F7_3], [LPA_L2].[F4_4], [LPA_L2].[F4_5]
FROM
(
SELECT [LPA_L3].[EmployeeID] AS [F7_0], [LPA_L3].[Name] AS [F7_1], [LPA_L3].[StartDate] AS [F7_2],
[LPA_L3].[WorksForDepartmentID] AS [F7_3], [LPA_L4].[ClerkID] AS [F4_4], [LPA_L4].[JobDescription] AS [F4_5]
FROM ( [InheritanceTwo].[dbo].[Employee] [LPA_L3] LEFT JOIN [InheritanceTwo].[dbo].[Clerk] [LPA_L4] ON
[LPA_L3].[EmployeeID]=[LPA_L4].[ClerkID])
) [LPA_L2]
) [LPA_L1]
WHERE ( ( [LPA_L1].[F4_4] IS NOT NULL))
So the logic I referred to does work, however it apparently goes wrong with individual fields, as this fails too:
var q1 = from c in metaData.Clerk
select c;
var q2 = from c in q1
select new { c.JobDescription };
var q = from c in q2
select c.JobDescription;
with the same error as you reported.
I hope to have a fix for you tomorrow (friday)
Joined: 11-Mar-2009
Hello Frans,
Thanks for the dll. It fixed the problem initially stated, but now, I unfortunately have a very similar error if I try to get an attribute from a related table, instead of using an attribute from the same table (i.e. I was using s.Category, now I try to get s.TextCategory.Code - Category is actually a foreign key to the look-up table TextCategory) .
var selection = from t in metaData.Text
select t;
var groups = from s in selection
group s by s.TextCategory.Code into g
select g.Key;
Generated Sql query:
Query: SELECT "LPA_L5"."ID" AS "F34_0", "LPA_L6"."ID" AS "F12_1", "LPA_L6"."STATUS" AS "F12_2", "LPA_L6"."DESCRIPTION" AS "F12_3", "LPA_L6"."ACCESSRULEACCESSRULE_ID_FK" AS "F12_4", "LPA_L6"."ARCHIVEMETARCHIVEMET_ID_FK" AS "F12_5", "LPA_L7"."ID" AS "F23_6", "LPA_L7"."ISPOTENTIAL" AS "F23_7", "LPA_L7"."INFORMATION_START" AS "F23_8", "LPA_L7"."INFORMATION_END" AS "F23_9", "LPA_L8"."ID" AS "F42_10", "LPA_L8"."CATEGORY" AS "F42_11", "LPA_L8"."TEXT" AS "F42_12" FROM ((( "switch_bg"."OBJECT" "LPA_L5" LEFT JOIN "switch_bg"."DATAOBJECT" "LPA_L6" ON "LPA_L5"."ID"="LPA_L6"."ID") LEFT JOIN "switch_bg"."INFORMATION" "LPA_L7" ON "LPA_L6"."ID"="LPA_L7"."ID") LEFT JOIN "switch_bg"."TEXT" "LPA_L8" ON "LPA_L7"."ID"="LPA_L8"."ID")
Method Exit: CreateSelectDQ
Method Exit: CreateSubQuery
Generated Sql query:
Query: SELECT "LPA_L4"."CODE" AS "Code" FROM ((SELECT "LPA_L5"."ID" AS "F34_0", "LPA_L6"."ID" AS "F12_1", "LPA_L6"."STATUS" AS "F12_2", "LPA_L6"."DESCRIPTION" AS "F12_3", "LPA_L6"."ACCESSRULEACCESSRULE_ID_FK" AS "F12_4", "LPA_L6"."ARCHIVEMETARCHIVEMET_ID_FK" AS "F12_5", "LPA_L7"."ID" AS "F23_6", "LPA_L7"."ISPOTENTIAL" AS "F23_7", "LPA_L7"."INFORMATION_START" AS "F23_8", "LPA_L7"."INFORMATION_END" AS "F23_9", "LPA_L8"."ID" AS "F42_10", "LPA_L8"."CATEGORY" AS "F42_11", "LPA_L8"."TEXT" AS "F42_12" FROM ((( "switch_bg"."OBJECT" "LPA_L5" LEFT JOIN "switch_bg"."DATAOBJECT" "LPA_L6" ON "LPA_L5"."ID"="LPA_L6"."ID") LEFT JOIN "switch_bg"."INFORMATION" "LPA_L7" ON "LPA_L6"."ID"="LPA_L7"."ID") LEFT JOIN "switch_bg"."TEXT" "LPA_L8" ON "LPA_L7"."ID"="LPA_L8"."ID")) "LPA_L3" LEFT JOIN "switch_bg"."TEXTCATEGORY" "LPA_L4" ON "LPA_L4"."CODE"="LPA_L3"."Category") GROUP BY "LPA_L4"."CODE"
Method Exit: CreateSelectDQ
Method Exit: CreateSubQuery
Generated Sql query:
Query: SELECT "LPA_L1"."Code" FROM (SELECT "LPA_L4"."CODE" AS "Code" FROM ((SELECT "LPA_L5"."ID" AS "F34_0", "LPA_L6"."ID" AS "F12_1", "LPA_L6"."STATUS" AS "F12_2", "LPA_L6"."DESCRIPTION" AS "F12_3", "LPA_L6"."ACCESSRULEACCESSRULE_ID_FK" AS "F12_4", "LPA_L6"."ARCHIVEMETARCHIVEMET_ID_FK" AS "F12_5", "LPA_L7"."ID" AS "F23_6", "LPA_L7"."ISPOTENTIAL" AS "F23_7", "LPA_L7"."INFORMATION_START" AS "F23_8", "LPA_L7"."INFORMATION_END" AS "F23_9", "LPA_L8"."ID" AS "F42_10", "LPA_L8"."CATEGORY" AS "F42_11", "LPA_L8"."TEXT" AS "F42_12" FROM ((( "switch_bg"."OBJECT" "LPA_L5" LEFT JOIN "switch_bg"."DATAOBJECT" "LPA_L6" ON "LPA_L5"."ID"="LPA_L6"."ID") LEFT JOIN "switch_bg"."INFORMATION" "LPA_L7" ON "LPA_L6"."ID"="LPA_L7"."ID") LEFT JOIN "switch_bg"."TEXT" "LPA_L8" ON "LPA_L7"."ID"="LPA_L8"."ID")) "LPA_L3" LEFT JOIN "switch_bg"."TEXTCATEGORY" "LPA_L4" ON "LPA_L4"."CODE"="LPA_L3"."Category") GROUP BY "LPA_L4"."CODE") "LPA_L1"
Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
Method Enter: DataAccessAdapterBase.OpenConnection
: Connection physically opened.
Method Exit: DataAccessAdapterBase.OpenConnection
A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>TestGoupLinq.vshost.exe</AppDomain><Exception><ExceptionType>SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException, SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27</ExceptionType><Message>An exception was caught during the execution of a retrieval query: ERROR: 42703: column LPA_L3.Category does not exist. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.</Message><StackTrace> at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchDataReader(IRetrievalQuery queryToExecute, CommandBehavior readerBehavior)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchProjection(List`1 valueProjectors, IGeneralDataProjector projector, IRetrievalQuery queryToExecute, Dictionary`2 typeConvertersToRun)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchProjection(List`1 valueProjectors, IGeneralDataProjector projector, IEntityFields2 fields, IRelationPredicateBucket filter, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IGroupByCollection groupByClause, Boolean allowDuplicates, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProvider2.ExecuteValueListProjection(QueryExpression toExecute)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.ExecuteExpression(Expression handledExpression)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.Execute(Expression expression)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.System.Linq.IQueryProvider.Execute(Expression expression)
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProQuery`1.Execute()
at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProQuery`1.System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator()
at TestGoupLinq.Program.Main(String[] args) in C:\Users\cschenk\Desktop\TestGoupLinq\TestGoupLinq\Program.cs:line 30
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: ERROR: 42703: column LPA_L3.Category does not exist. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---&gt; Npgsql.NpgsqlException:
column LPA_L3.Category does not exist
Severity: ERROR
Code: 42703
And similarly, the compact version works OK...
var groups = from t in metaData.Text
group t by t.TextCategory.Code into g
select g.Key;
Hmm....
SELECT "LPA_L1"."Code"
FROM
(
SELECT "LPA_L4"."CODE" AS "Code"
FROM
(
(
SELECT "LPA_L5"."ID" AS "F34_0", "LPA_L6"."ID" AS "F12_1", "LPA_L6"."STATUS" AS "F12_2", "LPA_L6"."DESCRIPTION" AS "F12_3",
"LPA_L6"."ACCESSRULEACCESSRULE_ID_FK" AS "F12_4", "LPA_L6"."ARCHIVEMETARCHIVEMET_ID_FK" AS "F12_5",
"LPA_L7"."ID" AS "F23_6", "LPA_L7"."ISPOTENTIAL" AS "F23_7", "LPA_L7"."INFORMATION_START" AS "F23_8",
"LPA_L7"."INFORMATION_END" AS "F23_9", "LPA_L8"."ID" AS "F42_10", "LPA_L8"."CATEGORY" AS "F42_11",
"LPA_L8"."TEXT" AS "F42_12"
FROM ((( "switch_bg"."OBJECT" "LPA_L5" LEFT JOIN "switch_bg"."DATAOBJECT" "LPA_L6"
ON "LPA_L5"."ID"="LPA_L6"."ID") LEFT JOIN "switch_bg"."INFORMATION" "LPA_L7"
ON "LPA_L6"."ID"="LPA_L7"."ID") LEFT JOIN "switch_bg"."TEXT" "LPA_L8"
ON "LPA_L7"."ID"="LPA_L8"."ID")
) "LPA_L3" LEFT JOIN "switch_bg"."TEXTCATEGORY" "LPA_L4"
ON "LPA_L4"."CODE"="LPA_L3"."Category"
) GROUP BY "LPA_L4"."CODE"
) "LPA_L1
It's clearly in the join with the derived table. I wonder why it doesn't correct the name there. I've to look into this. Hopefully monday will bring better news
I fixed it. It was a big problem to fix this as the join is implicit (derived table is referred to through an entity in a normal relation object, which was properly handled but after the derived table fields were 'corrected'. By splitting this up it was fixed.
I've to run the big unit-test suite (all linq tests pass, so it should be ok) still and then will attach a new build.
(edit) See attached build for the fix.