Bug 12800 - Problem with EntityFramework5 based application and Mono 3.0.11
Summary: Problem with EntityFramework5 based application and Mono 3.0.11
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-06-20 16:26 UTC by Viktor Sychev
Modified: 2013-07-01 14:39 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Log file, created with mono -v (3.65 MB, text/x-log)
2013-06-20 16:26 UTC, Viktor Sychev
Details

Description Viktor Sychev 2013-06-20 16:26:34 UTC
Created attachment 4171 [details]
Log file, created with mono -v

I'm trying to launch my application, which was developed using EntityFramework 5 and VisualStudio 2012 (.NET Framework versions 4.0 ( Generic profile) or 4.5), and have problems when my application tried to retrieve data from its datamodel. Under Microsoft Windows with original .NET Framework from Microsoft I haven't any problems( manually tested many times). 
Exception which was produced during code execution I will attach below after this message.

Unhandled Exception:
ProjectGenius.SystemCore.Kernel.Core.Exceptions.DatabaseException: При выполнении операции с БД возникла ошибка Unable to create a constant value of type 'ProjectGenius.SystemCore.Kernel.Schema.Core.rbac_username_db'. Only primitive types or enumeration types are supported in this context.
  at System.Data.Objects.ELinq.ExpressionConverter+ConstantTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.ConstantExpression linq) [0x00000] in <filename unknown>:0                                                                                                                                                                            
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.ConstantExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0                                                                                                                                              
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0                                                   
  at System.Data.Objects.ELinq.ExpressionConverter+NewArrayInitTranslator+<>c__DisplayClass88.<TypedTranslate>b__86 (System.Linq.Expressions.Expression e) [0x00000] in <filename unknown>:0         
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator1A`2[System.Linq.Expressions.Expression,System.Data.Common.CommandTrees.DbExpression].MoveNext () [0x00000] in <filename unknown>:0     
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.EnumerableValidator`3[System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.Internal.DbExpressionList].Validate (IEnumerable`1 argument, System.String argumentName, Int32 expectedElementCount, Boolean allowEmpty, System.Func`3 map, System.Func`2 collect, System.Func`3 deriveName) [0x00000] in <filename unknown>:0                                                                                                                                                 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.EnumerableValidator`3[System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.Internal.DbExpressionList].Validate () [0x00000] in <filename unknown>:0                                                                                                                  
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CreateExpressionList (IEnumerable`1 arguments, System.String argumentName, Boolean allowEmpty, System.Action`2 validationCallback) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CreateExpressionList (IEnumerable`1 arguments, System.String argumentName, System.Action`2 validationCallback) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.ValidateNewCollection (IEnumerable`1 elements, System.Data.Common.CommandTrees.Internal.DbExpressionList& validElements) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.CreateNewCollection (IEnumerable`1 elements) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.NewCollection (IEnumerable`1 elements) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+NewArrayInitTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.NewArrayExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.NewArrayExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+ConstantTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.ConstantExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.ConstantExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateSet (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator+JoinTranslator.Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression call) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator+SequenceMethodTranslator.Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression call, SequenceMethod sequenceMethod) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.MethodCallExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.Convert () [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan (Nullable`1 forMergeOption) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ObjectQuery`1[ProjectGenius.SystemCore.Kernel.Core.Utils.Samdb.BriefUserInfo].GetResults (Nullable`1 forMergeOption) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: ProjectGenius.SystemCore.Kernel.Core.Exceptions.DatabaseException: При выполнении операции с БД возникла ошибка Unable to create a constant value of type 'ProjectGenius.SystemCore.Kernel.Schema.Core.rbac_username_db'. Only primitive types or enumeration types are supported in this context.
  at System.Data.Objects.ELinq.ExpressionConverter+ConstantTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.ConstantExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.ConstantExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+NewArrayInitTranslator+<>c__DisplayClass88.<TypedTranslate>b__86 (System.Linq.Expressions.Expression e) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator1A`2[System.Linq.Expressions.Expression,System.Data.Common.CommandTrees.DbExpression].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.EnumerableValidator`3[System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.Internal.DbExpressionList].Validate (IEnumerable`1 argument, System.String argumentName, Int32 expectedElementCount, Boolean allowEmpty, System.Func`3 map, System.Func`2 collect, System.Func`3 deriveName) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.EnumerableValidator`3[System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.Internal.DbExpressionList].Validate () [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CreateExpressionList (IEnumerable`1 arguments, System.String argumentName, Boolean allowEmpty, System.Action`2 validationCallback) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CreateExpressionList (IEnumerable`1 arguments, System.String argumentName, System.Action`2 validationCallback) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.ValidateNewCollection (IEnumerable`1 elements, System.Data.Common.CommandTrees.Internal.DbExpressionList& validElements) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.CreateNewCollection (IEnumerable`1 elements) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.NewCollection (IEnumerable`1 elements) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+NewArrayInitTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.NewArrayExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.NewArrayExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+ConstantTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.ConstantExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.ConstantExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateSet (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator+JoinTranslator.Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression call) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator+SequenceMethodTranslator.Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression call, SequenceMethod sequenceMethod) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.MethodCallExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.Convert () [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan (Nullable`1 forMergeOption) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ObjectQuery`1[ProjectGenius.SystemCore.Kernel.Core.Utils.Samdb.BriefUserInfo].GetResults (Nullable`1 forMergeOption) [0x00000] in <filename unknown>:0
Comment 1 Viktor Sychev 2013-06-22 00:48:09 UTC
Bug was produced by function, during LINQ operation:

        public IList<Utils.Samdb.BriefUserInfo> ListUsers_Brief()
        {
            IList<Utils.Samdb.BriefUserInfo> briefList = new List<Utils.Samdb.BriefUserInfo>();
            lock (_Locker)
            {
                try
                {
                    foreach (Utils.Samdb.BriefUserInfo briefInfo in from users in Context.rbac_users join usernames in Context.rbac_username_db on users.username equals usernames.username select new Utils.Samdb.BriefUserInfo() { Name = usernames.data, Uid = users.user_id })
                    {
                        briefList.Add(briefInfo);
                    }
                }
                catch (Exception dbException)
                {
                    throw new Exceptions.DatabaseException(dbException.Message, dbException.StackTrace);
                }
            }
            return briefList;
        }

Note You need to log in before you can comment on or make changes to this bug.