﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>CapableObjects Forums / ECO / General discussions  / Eco is generating a broken SQL statement / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>CapableObjects Forums</description><link>http://www.capableobjects.com/apps/InstantForum414/</link><webMaster>forums@capableobjects.com</webMaster><lastBuildDate>Wed, 08 Feb 2012 22:26:25 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Eco is generating a broken SQL statement</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic515-4-1.aspx</link><description>I dont know exactly what is wrong, but it is obvious that the generated SQL is invalid. If the persistencemapper is able to load data in other cases, it is likely that what has happened is that you have passed the magic number where ECO switches from using parameters to literal IDs in the "where-statement". &lt;br&gt;&lt;br&gt;While I would like to know exactly why this causes invalid SQL, I can offer you a workaround until we have figured this out. There is a property that controls this magic number:&lt;br&gt;&lt;br&gt;persistenceMapperMySql1.SqlDatabaseConfig.MaxParamsInIdList&lt;br&gt;&lt;br&gt;Set this value to 250 (same as the property FetchBlockSize). this will force ECO to always pass the values for the primary keys as parameters.&lt;br&gt;&lt;br&gt;Now, to solve the actual problem, I need to know which build you are using, and whether you have any custom O/R mapping in your application. I have recently been testing large amounts of data with MySql (in Eco5), and not seen this particular problem...</description><pubDate>Wed, 08 Oct 2008 22:00:48 GMT</pubDate><dc:creator>Jonas Hogstrom</dc:creator></item><item><title>RE: Eco is generating a broken SQL statement</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic515-4-1.aspx</link><description>Hi Scott,&lt;br&gt;&lt;br&gt;I don't know. It seems such a common scenario, just retrieving some data from a table. The only thing that changed is that now I have a few hundred lines.&lt;br&gt;&lt;br&gt;The application that I'm writing performs import and export operations, so I can't run away from loading this amount of data.&lt;br&gt;&lt;br&gt;Do you really think it is a bug?&lt;br&gt;&lt;br&gt;Thanks</description><pubDate>Wed, 08 Oct 2008 16:13:49 GMT</pubDate><dc:creator>pedro_brown</dc:creator></item><item><title>RE: Eco is generating a broken SQL statement</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic515-4-1.aspx</link><description>Hi Pedro,&lt;br&gt;&lt;br&gt;&lt;br&gt;Have you reported this as a bug?  It seems to be incorrect at first glance.&lt;br&gt;&lt;br&gt;&lt;br&gt;Scott :)</description><pubDate>Wed, 08 Oct 2008 15:39:44 GMT</pubDate><dc:creator>Scott Price</dc:creator></item><item><title>RE: Eco is generating a broken SQL statement</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic515-4-1.aspx</link><description>Hi,&lt;br&gt;&lt;br&gt;I attached the error screen.&lt;br&gt;&lt;br&gt;Here is the Stack Trace:&lt;br&gt;&lt;br&gt;   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +2668969&lt;br&gt;   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type) +717&lt;br&gt;   Eco.Persistence.IPersistenceMapper.Fetch(ObjectIdList idList, Datablock&amp; datablock, Int32[] memberIdList, FetchStrategy fetchStrategy) +0&lt;br&gt;   Eco.Persistence.Remoting.ClientMapperImpl.Eco.Persistence.IPersistenceMapper.Fetch(ObjectIdList idList, Datablock&amp; datablock, Int32[] memberIdList, FetchStrategy fetchStrategy) in c:\dev\e4vs\source\Public.CLR\Persistence\PersistenceMapperClient.cs:141&lt;br&gt;   Eco.Internal.TBoldSystemPersistenceHandler.Fetch(Locator[] locators, Int32[] members, FetchStrategy FetchStrategy) in source\ObjectSpace\BORepresentation\BoldSystemPersistenceHandler.pas:420&lt;br&gt;   Eco.Services.Impl.PersistenceServiceImpl.Eco.Services.IPersistenceService.EnsureRange(IObjectList objects, Int32 fromIndex, Int32 toIndex) in c:\dev\e4vs\source\Public.CLR\ServicesImpl\PersistenceServiceImpl.cs:242&lt;br&gt;   Eco.Services.ObjectListHelper.EnsureFetchedPage(IObjectList list, IObject obj, Int32 index) in c:\dev\e4vs\source\Public.CLR\Interfaces\Services.cs:1867&lt;br&gt;   Eco.ObjectRepresentation.Impl.ObjectCollectionImpl.GetByIndex(Int32 index) in c:\dev\e4vs\source\Public.CLR\ElementImpl\ObjectCollectionImpl.cs:169&lt;br&gt;   Eco.ObjectRepresentation.Impl.ObjectCollectionImpl.Eco.ObjectRepresentation.IObjectList.get_Item(Int32 index) in c:\dev\e4vs\source\Public.CLR\ElementImpl\ObjectCollectionImpl.cs:182&lt;br&gt;   Eco.Web.AutoFormDataGrid.UpdateList(IObjectList list) in c:\dev\e4vs\source\Public.CLR\Handles\Asp\MultiLinkBuilder.cs:128&lt;br&gt;   Eco.Web.MultiLinkBuilder.MakeNewDataGrid(String controlName, Control host, HttpRequest request, HttpSessionState session, EcoSpace ecoSpace, IObjectList list, String ownerId, Int32 ownerProperty, Boolean selector, String className, IProperty prop) in c:\dev\e4vs\source\Public.CLR\Handles\Asp\MultiLinkBuilder.cs:217&lt;br&gt;   Eco.Web.AutoForm.BuildObjectList(String ownerId, Int32 ownerProperty, String className) in c:\dev\e4vs\source\Public.CLR\Handles\Asp\AutoForm.cs:309&lt;br&gt;   Eco.Web.AutoForm.SetupPage() in c:\dev\e4vs\source\Public.CLR\Handles\Asp\AutoForm.cs:130&lt;br&gt;   Eco.Web.AutoForm.Page_Load(Object sender, EventArgs e) in c:\dev\e4vs\source\Public.CLR\Handles\Asp\AutoForm.cs:47&lt;br&gt;   System.EventHandler.Invoke(Object sender, EventArgs e) +0&lt;br&gt;   System.Web.UI.Control.OnLoad(EventArgs e) +99&lt;br&gt;   System.Web.UI.Control.LoadRecursive() +47&lt;br&gt;   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436&lt;br&gt;&lt;br&gt;Thanks</description><pubDate>Wed, 08 Oct 2008 15:02:35 GMT</pubDate><dc:creator>pedro_brown</dc:creator></item><item><title>RE: Eco is generating a broken SQL statement</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic515-4-1.aspx</link><description>Hi everyone,&lt;br&gt;&lt;br&gt;Can someone help me on this? It's very frustating as it prevents me from moving on with my project. I tested with MSSQL and the same error occurs.&lt;br&gt;&lt;br&gt;I'll try to explain the problem:&lt;br&gt;  1) Model: [b]SS[/b] 0..1 -- 0..* [b]OS[/b] 0..1 -- 0..* [b]Task[/b]&lt;br&gt;  2) At some point, I have a SS Object and I try to execute [b]ActionLanguage.Execute(SS.AsIObject, 'self.OSs.Tasks-&gt;collect(Enabled := false)');[/b]&lt;br&gt;&lt;br&gt;And then the hole problem happens as it appears thar ECO generates de SQL select statement without the Parameters, just [b]select someting from somewhere where ECO_ID in ( , , , , , )[/b]&lt;br&gt;&lt;br&gt;Please tell me if I'm making some kid of mistake.</description><pubDate>Tue, 07 Oct 2008 15:05:54 GMT</pubDate><dc:creator>pedro_brown</dc:creator></item><item><title>RE: Eco is generating a broken SQL statement</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic515-4-1.aspx</link><description>Hi,&lt;br&gt;&lt;br&gt;Could someone help me on this? if you take a look at the SQL statement (attached), you will notice that it will attempt to select several objects using a IN clause. Could that be the problem?</description><pubDate>Mon, 06 Oct 2008 14:22:03 GMT</pubDate><dc:creator>pedro_brown</dc:creator></item><item><title>Eco is generating a broken SQL statement</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic515-4-1.aspx</link><description>Hi everyone,&lt;br&gt;&lt;br&gt;Maybe I'm doing something wrong here, but this is the error I've been dealing with:&lt;br&gt;&lt;br&gt;When I try to execute the folowing OCL ([i]self.Ordens.TarefaProject-&gt;select(Enabled)-&gt;orderBy(TaskID)[/i]) a exception is thrown. I've added several error messages and print screens to this post to help explain myself.&lt;br&gt;&lt;br&gt;I hove that some one can help me. &lt;br&gt;&lt;br&gt;Thanks in advance.</description><pubDate>Fri, 03 Oct 2008 15:21:18 GMT</pubDate><dc:creator>pedro_brown</dc:creator></item></channel></rss>
