Bug with linq to postgresql with mono

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
fcasado
Posts: 3
Joined: Wed 02 Sep 2009 10:28

Bug with linq to postgresql with mono

Post by fcasado » Wed 02 Sep 2009 10:39

Hi,
I know it's not the easiest configuration to run but here it is:

mono 2.4.2.3 and mod_mono 2.4.2 manually compiled
apache 2.2.11
PostgreSQL 8.3

The application is an ASP.NET MVC application which is running perfectly under windows debug server.

Under apache (and the configuration descripbed), pages works while they don't access to the database throught LinqToSQL model generated with Entity Developer for dotConnect 2.20.35.

Once a page is accessing to the datamodel, here is the stacktrace sample:

Server Error in '/macrofarm' Application
Field `AXISTaskSetManager.Models.Workflow:_WorkflowId' is inaccessible from method `(wrapper dynamic-method) object:xget__WorkflowId_55 (AXISTaskSetManager.Models.Workflow)'

Description: HTTP 500. Error processing request.

Stack Trace:

System.FieldAccessException: Field `AXISTaskSetManager.Models.Workflow:_WorkflowId' is inaccessible from method `(wrapper dynamic-method) object:xget__WorkflowId_55 (AXISTaskSetManager.Models.Workflow)'

at (wrapper managed-to-native) System.Delegate:CreateDelegate_internal (System.Type,object,System.Reflection.MethodInfo)
at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00251] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/corlib/System/Delegate.cs:256
at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/corlib/System/Delegate.cs:278
at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method) [0x00000] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/corlib/Assembly/AssemblyInfo.cs:1
at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00029] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs:176
at Devart.Data.Linq.Mapping.m.a (System.Type A_0, System.Reflection.FieldInfo A_1) [0x00000]
at Devart.Data.Linq.Mapping.f.a (System.Type A_0, System.Reflection.MemberInfo A_1, System.Data.Linq.Mapping.MetaAccessor A_2) [0x00000]
at Devart.Data.Linq.Mapping.f.a () [0x00000]
at Devart.Data.Linq.Mapping.f.i () [0x00000]
at Devart.Data.Linq.Provider.Query.ao.a (Devart.Data.Linq.Provider.Query.f A_0, System.Data.Linq.Mapping.MetaType A_1, System.Collections.Generic.List`1& A_2, System.Collections.Generic.List`1& A_3, Devart.Data.Linq.Provider.Query.SqlExpression& A_4, IList`1 A_5) [0x00000]
at Devart.Data.Linq.Provider.Query.ao.b (Devart.Data.Linq.Provider.Query.f A_0, System.Data.Linq.Mapping.MetaType A_1, System.Collections.Generic.List`1& A_2, System.Collections.Generic.List`1& A_3, Devart.Data.Linq.Provider.Query.SqlExpression& A_4, IList`1 A_5) [0x00000]
at Devart.Data.Linq.Provider.Query.ao.a (Devart.Data.Linq.Provider.Query.f A_0, IList`1 A_1) [0x00000]
at Devart.Data.Linq.Provider.Query.ao.a (System.Data.Linq.Mapping.MetaType A_0, ITable A_1, IList`1 A_2) [0x00000]
at Devart.Data.Linq.Provider.Query.ao.a (System.Data.Linq.Mapping.MetaType A_0, ITable A_1) [0x00000]
at Devart.Data.Linq.Provider.Query.bk.a (ITable A_0) [0x00000]
at Devart.Data.Linq.Provider.Query.bk.a (System.Linq.Expressions.ConstantExpression A_0) [0x00000]
at Devart.Data.Linq.Provider.Query.bk.j (System.Linq.Expressions.Expression A_0) [0x00000]
at Devart.Data.Linq.Provider.Query.bk.i (System.Linq.Expressions.Expression A_0) [0x00000]
at Devart.Data.Linq.Provider.DataProvider.a (System.Linq.Expressions.Expression A_0) [0x00000]
at Devart.Data.Linq.Provider.DataProvider.i (System.Linq.Expressions.Expression A_0) [0x00000]
at Devart.Data.Linq.Table`1[AXISTaskSetManager.Models.Workflow].b () [0x00000]
at Devart.Data.Linq.Table`1[AXISTaskSetManager.Models.Workflow].GetEnumerator () [0x00000]
at Devart.Data.Linq.Table`1[AXISTaskSetManager.Models.Workflow].j () [0x00000]
at ASP.views_workflow_index_aspx.__Render_Content2 (System.Web.UI.HtmlTextWriter __output, System.Web.UI.Control parameterContainer) [0x0000b] in /var/www/macrofarm/Views/Workflow/Index.aspx:22
at System.Web.UI.Control.RenderChildren (System.Web.UI.HtmlTextWriter writer) [0x0000b] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1129
at System.Web.UI.Control.Render (System.Web.UI.HtmlTextWriter writer) [0x00000] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1118
at System.Web.UI.Control.RenderControl (System.Web.UI.HtmlTextWriter writer) [0x0005f] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1310
at ASP.views_shared_site_master.__RenderTree (System.Web.UI.HtmlTextWriter __output, System.Web.UI.Control parameterContainer) [0x000d4] in /tmp/www-data-temp-aspnet-0/af7f4991/App_Web_17ad5a0_1.cs:148
at System.Web.UI.Control.RenderChildren (System.Web.UI.HtmlTextWriter writer) [0x0000b] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1129
at System.Web.UI.Control.Render (System.Web.UI.HtmlTextWriter writer) [0x00000] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1118
at System.Web.UI.Control.RenderControl (System.Web.UI.HtmlTextWriter writer) [0x0005f] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1310
at System.Web.UI.Control.RenderChildren (System.Web.UI.HtmlTextWriter writer) [0x0006d] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1143
at System.Web.UI.Control.Render (System.Web.UI.HtmlTextWriter writer) [0x00000] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1118
at System.Web.UI.Page.Render (System.Web.UI.HtmlTextWriter writer) [0x00172] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Page.cs:1136
at System.Web.Mvc.ViewPage.Render (System.Web.UI.HtmlTextWriter writer) [0x00000]
at System.Web.UI.Control.RenderControl (System.Web.UI.HtmlTextWriter writer) [0x0005f] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Control.cs:1310
at System.Web.UI.Page.RenderPage () [0x00032] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Page.cs:1679
at System.Web.UI.Page.InternalProcessRequest () [0x001d7] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Page.cs:1544
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x0005b] in /home/speeral/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/Page.cs:1353

Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433








The bug is on pages accessing to

fcasado
Posts: 3
Joined: Wed 02 Sep 2009 10:28

Post by fcasado » Wed 02 Sep 2009 13:03

Maybe that can help, in the autogenerated DataContext file, if I replace all the private properties _prop to public properties:

I get this:
Bad Storage property: '_TSId' on member 'AXISTaskSetManager.Models.TaskSet.TSId'

Description: HTTP 500. Error processing request.

Stack Trace:

System.InvalidOperationException: Bad Storage property: '_TSId' on member 'AXISTaskSetManager.Models.TaskSet.TSId'
at Devart.Data.Linq.Mapping.f..ctor (Devart.Data.Linq.Mapping.h,System.Reflection.MemberInfo,int)
at Devart.Data.Linq.Mapping.h.e ()
at Devart.Data.Linq.Mapping.h..ctor (System.Data.Linq.Mapping.MetaModel,System.Data.Linq.Mapping.MetaTable,System.Type,System.Data.Linq.Mapping.MetaType)
at Devart.Data.Linq.Mapping.p..ctor (Devart.Data.Linq.Mapping.d,Devart.Data.Linq.Mapping.a,System.Type)
at Devart.Data.Linq.Mapping.a..ctor (Devart.Data.Linq.Mapping.d,System.Data.Linq.Mapping.TableAttribute,System.Type)
at Devart.Data.Linq.Mapping.d.d (System.Type)
at Devart.Data.Linq.Mapping.d.b (System.Type)
at Devart.Data.Linq.DataContext.GetTable ()
at AXISTaskSetManager.Models.MacroFarmDataBaseDataContext.get_TaskSets ()
at AXISTaskSetManager.Controllers.TaskSetController.Index ()
at (wrapper dynamic-method) System.Runtime.CompilerServices.ExecutionScope.lambda_method (System.Runtime.CompilerServices.ExecutionScope,System.Web.Mvc.ControllerBase,object[])
at System.Web.Mvc.ActionMethodDispatcher.Execute (System.Web.Mvc.ControllerBase,object[])
at System.Web.Mvc.ReflectedActionDescriptor.Execute (System.Web.Mvc.ControllerContext,System.Collections.Generic.IDictionary`2)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod (System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionDescriptor,System.Collections.Generic.IDictionary`2)
at System.Web.Mvc.ControllerActionInvoker/c__DisplayClassa.b__7 ()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter (System.Web.Mvc.IActionFilter,System.Web.Mvc.ActionExecutingContext,System.Func`1)

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 03 Sep 2009 07:10

Sorry, we have not made any LINQ to PostgreSQL tests on Mono. This functionality is not supported yet.
Unfortunately, I can't provide any timeframe for this support at the moment.

fcasado
Posts: 3
Joined: Wed 02 Sep 2009 10:28

Post by fcasado » Thu 03 Sep 2009 09:00

Ok, thank you for your answer.

Maybe you can help me with telling which other database I can use with linq from a mono application?
Can I access a sql server express one using linq? Or maybe MySQL...
My issue, is that I bought the dotconnect for postgreSQL specially for this...

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 07 Sep 2009 07:16

We didn't test of our LINQ support for Mono with any of our providers. We will notify you when this support is implemented and tests are made.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 20 May 2010 13:16

Here are the results. Application that uses LINQ will work on Mono if it was built on Windows.
If application is built on Mono, there will be the problems with the Expression compilation (Mono composes expression in an incorrect way; tested with LINQ to MSSQL).

Post Reply