Exception while using #bind() in Raw SQL Query under SQL Server 2008

From: Gary Jarrel (garyjarre..mail.com)
Date: Thu May 20 2010 - 04:45:37 UTC

  • Next message: Mark Fraser: "Building dataview jar for use with Cayenne 3.0 (or...is ANYONE using dataviews in 3.0?)"

    Hi Again!

    Another interesting exception that I just came across although it
    could be more related to SQL Server or the JTDS Driver that I am using
    but basically when I have a RAW SQL Query as follows:

    SELECT * FROM com1.active_products ap
    WHERE contains(ap.*, #bind($searchParam))
    ORDER BY ap.category_name

    I get the following exception:

    INFO org.apache.cayenne.access.QueryLogger (QueryLogger.java:453) - *** error.
    java.sql.SQLException: I/O Error: Connection reset
            at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1053)
            at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:537)
            at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.java:560)
            at org.apache.cayenne.access.jdbc.SQLTemplateAction.execute(SQLTemplateAction.java:160)
            at org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:134)
            at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
            at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:269)
            at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:422)
            at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:69)
            at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:395)
            at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)

    However if I change the where clause to: ontains(ap.*, '$searchParam')

    It works perfectly fine:

    The search param that I am using is: "aavara*" (as is including the
    quotation marks as specified in the SQL Server Free Text search
    documentation)

    Any ideas would be much appreciated!

    Cheers,

    Gary



    This archive was generated by hypermail 2.0.0 : Thu May 20 2010 - 04:46:11 UTC