google-code-export / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
Other
0 stars 0 forks source link

Fails to insert entities on SubmitChanges #338

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use a context generated from a mysql database (dbmetal, MONO_STRICT)
2. Use InsertOnSubmit() and SubmitChanges()

What is the expected output? What do you see instead?
The entity should be persisted.
An exception occurs.
System.ArgumentException: Argument types do not match
  at System.Linq.Expressions.Expression.Bind (System.Reflection.MemberInfo member, System.Linq.Expressions.Expression expression) [0x0003d] in \mono-2.10.8\mcs\class\dlr\Runtime\Microsoft.Scripting.Core\Ast\MemberAssignment.cs:79 
  at DbLinq.Data.Linq.Sugar.Implementation.ExpressionDispatcher.GetOutputTableReader (DbLinq.Data.Linq.Sugar.Expressions.TableExpression tableExpression, System.Linq.Expressions.ParameterExpression dataRecordParameter, System.Linq.Expressions.ParameterExpression mappingContextParameter, DbLinq.Data.Linq.Sugar.BuilderContext builderContext) [0x00063] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Sugar\Implementation\ExpressionDispatcher.Registrar.cs:399 
  at DbLinq.Data.Linq.Sugar.Implementation.ExpressionDispatcher.CutOutOperands (System.Linq.Expressions.Expression expression, System.Linq.Expressions.ParameterExpression dataRecordParameter, System.Linq.Expressions.ParameterExpression mappingContextParameter, DbLinq.Data.Linq.Sugar.BuilderContext builderContext) [0x00019] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Sugar\Implementation\ExpressionDispatcher.cs:177 
  at DbLinq.Data.Linq.Sugar.Implementation.ExpressionDispatcher.CutOutOperands (System.Linq.Expressions.Expression selectExpression, DbLinq.Data.Linq.Sugar.BuilderContext builderContext) [0x0002a] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Sugar\Implementation\ExpressionDispatcher.cs:152 
  at DbLinq.Data.Linq.Sugar.Implementation.ExpressionDispatcher.BuildSelect (System.Linq.Expressions.Expression selectExpression, DbLinq.Data.Linq.Sugar.BuilderContext builderContext) [0x00038] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Sugar\Implementation\ExpressionDispatcher.cs:106 
  at DbLinq.Data.Linq.Sugar.Implementation.QueryBuilder.BuildExpressionQuery (DbLinq.Data.Linq.Sugar.ExpressionChain expressions, System.Linq.Expressions.Expression tableExpression, DbLinq.Data.Linq.Sugar.BuilderContext builderContext) [0x00010] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Sugar\Implementation\QueryBuilder.cs:204 
  at DbLinq.Data.Linq.Sugar.Implementation.QueryBuilder.BuildExpressionQuery (DbLinq.Data.Linq.Sugar.ExpressionChain expressions, DbLinq.Data.Linq.Sugar.BuilderContext builderContext) [0x00019] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Sugar\Implementation\QueryBuilder.cs:182 
  at DbLinq.Data.Linq.Sugar.Implementation.QueryBuilder.BuildExpressionQuery (DbLinq.Data.Linq.Sugar.ExpressionChain expressions, DbLinq.Data.Linq.Sugar.QueryContext queryContext) [0x00007] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Sugar\Implementation\QueryBuilder.cs:76 
  at DbLinq.Data.Linq.Sugar.Implementation.QueryBuilder.GetSelectQuery (DbLinq.Data.Linq.Sugar.ExpressionChain expressions, DbLinq.Data.Linq.Sugar.QueryContext queryContext) [0x00020] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Sugar\Implementation\QueryBuilder.cs:393 
  at DbLinq.Data.Linq.Implementation.QueryProvider`1[GwTimer.Data.Sql.DragonParticipation].GetQuery (System.Linq.Expressions.Expression expression) [0x00015] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Implementation\QueryProvider.cs:165 
  at DbLinq.Data.Linq.Implementation.QueryProvider`1[GwTimer.Data.Sql.DragonParticipation].GetEnumerator () [0x00000] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\Implementation\QueryProvider.cs:215 
  at System.Collections.Generic.List`1[GwTimer.Data.Sql.DragonParticipation].AddEnumerable (IEnumerable`1 enumerable) [0x00000] in \mono-2.10.8\mcs\class\corlib\System.Collections.Generic\List.cs:126 
  at System.Collections.Generic.List`1[GwTimer.Data.Sql.DragonParticipation]..ctor (IEnumerable`1 collection) [0x0002f] in \mono-2.10.8\mcs\class\corlib\System.Collections.Generic\List.cs:63 
  at System.Linq.Enumerable.ToList[DragonParticipation] (IEnumerable`1 source) [0x00006] in \mono-2.10.8\mcs\class\System.Core\System.Linq\Enumerable.cs:2847 
  at System.Data.Linq.EntitySet`1[GwTimer.Data.Sql.DragonParticipation].get_Source () [0x0001d] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\EntitySet.cs:61 
  at System.Data.Linq.EntitySet`1[GwTimer.Data.Sql.DragonParticipation].GetEnumerator () [0x00007] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\EntitySet.cs:133 
  at System.Data.Linq.EntitySet`1[GwTimer.Data.Sql.DragonParticipation].System.Collections.IEnumerable.GetEnumerator () [0x00000] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\EntitySet.cs:142 
  at System.Data.Linq.DataContext.UpdateReferencedObjects (System.Object root) [0x0010e] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\DataContext.cs:553 
  at System.Data.Linq.DataContext.InsertEntity (System.Object entity, DbLinq.Data.Linq.Sugar.QueryContext queryContext) [0x00023] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\DataContext.cs:510 
  at System.Data.Linq.DataContext.SubmitChangesImpl (ConflictMode failureMode) [0x0012c] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\DataContext.cs:451 
  at System.Data.Linq.DataContext.SubmitChanges (ConflictMode failureMode) [0x00051] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\DataContext.cs:406 
  at System.Data.Linq.DataContext.SubmitChanges () [0x00000] in \mono-2.10.8\mcs\class\System.Data.Linq\src\DbLinq\Data\Linq\DataContext.cs:368 

What version of the product are you using? On what operating system?
System.Data.Linq 4.0 from mono there-is-no-version-indicated
MonoDevelop 3.0.6 on Windows with mono runtime

Please provide any additional information below.
It occurs with a few tables from my model. 
Not really expecting a solution. I spent the last 5 days debugging issues 
within dbmetal.exe and DbLinq. I resolved some. Now I'm going with good old SQL 
queries because this project seems to be obsolete (has it ever worked?).

Original issue reported on code.google.com by Antoine....@gmail.com on 26 Jan 2013 at 10:29