System.InvalidOperationException: JdbcType

4 posts, 0 answers
  1. Daniel
    Daniel avatar
    3 posts
    Member since:
    Jan 2011

    Posted 08 Jan 2011 Link to this post

    Hi there;

    After upgrading from 2010.1.527.2 to the versions currently available (2010.3 1110 or 2010.3 1125), the following query is generating an exception:

    public static List<Merchant> SearchByName(String nameToSearch, Int32 index, Int32 max, Int32 statusID, FetchPlan fp,  out Int32 virtCount)
            {
                IObjectScope scope = ScopeUtility.GetScope();

                var list = from c in scope.Extent<Merchant>()
                           where (c.Name.ToUpper().Contains(nameToSearch.ToUpper()) || nameToSearch == String.Empty)
                           orderby c.Name
                           select c;

    Exception Details: System.InvalidOperationException: JdbcType

    Source Error:

    Line 169:            }
    Line 170:
    Line 171:            virtCount = list.Count();
    Line 172:            return list.Skip(index).Take(max).ToList();
    Line 173:        }


    Stack Trace:

    [InvalidOperationException: JdbcType]
       Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQueryImpl(Type type, Int32 elementAt, Object[] groupResolutionParamValues, Boolean single) +1472
       Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQuery(Type type, Int32 elementAt, Object[] groupResolutionParamValues, Boolean single) +107

    [InvalidOperationException: An exception occured during the execution of '
    Extent<XX.Data.Merchant>.Where(c => (c.Name.ToUpper().Contains(value(XX.BLL.MerchantUtility+<>c__DisplayClass4).nameToSearch.ToUpper()) || (value(XX.BLL.MerchantUtility+<>c__DisplayClass4).nameToSearch = String.Empty))).OrderBy(c => c.Name)'. See InnerException for more details.
    ]
       Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQuery(Type type, Int32 elementAt, Object[] groupResolutionParamValues, Boolean single) +468
       Telerik.OpenAccess.Query.ExpressionExecution.PerformQueryCount(Piece`1 piece) +98
       Telerik.OpenAccess.Query.ExpressionExecution.PerformQuerySingle(Piece`1 piece, Expression expression) +445
       Telerik.OpenAccess.Query.Piece`1.System.Linq.IQueryProvider.Execute(Expression expr) +78
       System.Linq.Queryable.Count(IQueryable`1 source) +310
       XX.BLL.MerchantUtility.SearchByName(String nameToSearch, Int32 index, Int32 max, Int32 statusID, FetchPlan fp, Int32& virtCount)
       XX.Controls.Merchant_List.BindRep()
       XX.Controls.Merchant_List.BindData()
       XX.Controls.Merchant_Manager.OnLoad(EventArgs e)
       System.Web.UI.Control.LoadRecursive() +66
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
       System.Web.UI.Control.LoadRecursive() +191
  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 10 Jan 2011 Link to this post

    Hello Daniel,

    I can reproduce this issue, and we will be working on a fix for that. In the mean time, you could rewrite and simplify your query in a way that makes it easier to interpret and to handle the query on the server:

    IObjectScope scope = GetScope();
    IQueryable<Merchant> source = scope.Extent<Merchant>();
    if (string.IsNullOrEmpty(nameToSearch) == false)
    {
       var arg = nameToSearch.ToUpper();
       source = source.Where(x => x.Name.ToUpper().Contains(arg));
    }
    var list = source.OrderBy(x => x.Name);
    virtCount = list.Count();
    return list.Skip(index).Take(max).ToList();

    We will also think about providing an extension method that allows to express the Contains() with ignore case semantics; this is a really missing alias to a.IndexOf(b, StringComparison.OrdinalIgnoreCase) >= 0.

    All the best,
    Thomas
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
  3. DevCraft banner
  4. Daniel
    Daniel avatar
    3 posts
    Member since:
    Jan 2011

    Posted 13 Feb 2011 Link to this post

    The same issue is appearing elsehwere throughout a legacy code base - code was tested and released to production on 2010.1.527.2... any chance you can make that version available for download, even if it's not supported? When is the next release that's supposed to have fixes for these issues expected?

     IObjectScope scope = ScopeUtility.GetScope();
                var a = from fn in scope.Extent<RewardOrder>()
                        where
                            (fn.Merchant.MerchantID == merchantID || merchantID == 0)
                            && ((fn.OrderDate.Date >= startDate && fn.OrderDate.Date <= endDate) || startDate == endDate)
                            && (search == ""
                                || fn.Merchant.Name.ToLower().Contains(search)
                                || fn.RewardOrderItems.Any(x => x.RewardTitle.ToLower().Contains
                                    (search)))
                        orderby fn.OrderDate descending
                        select fn;
  5. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 15 Feb 2011 Link to this post

    Hello Daniel,

    the issue is fixed and the fix will be contained in the 2011 Q1 release, that will be downloadable within the next 4 weeks. At the moment, there is no plan to release another build before.

    Greetings,
    Thomas
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Back to Top