[jira] Commented: (CAY-1064) Exception for unsupported expression comes too late

From: Andrus Adamchik (JIRA) ("Andrus)
Date: Fri Jun 06 2008 - 06:50:52 EDT

  • Next message: JIRA: "[jira] Commented: (CAY-1064) Exception for unsupported expression comes too late"

        [ https://issues.apache.org/cayenne/browse/CAY-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928#action_12928 ]

    Andrus Adamchik commented on CAY-1064:
    --------------------------------------

    > Is there a way, short of reading the source code, that I can tell which adapters support which features?

    This is actually a good question... On the surface I'd say - no there is no reasonable way to reliably report each case of DB-specific limitations. However there is probably a way to at least document the known cases.... the solution is related to our unit tests. Currently we have a per-DbAdapter unit test adapter [1] that defines boolean flags for support of this or that feature in the target DB. Corresponding unit test would check this flag and will skip its checks if the feature is not supported. I wanted to generalize that a bit to simplify per-adapter test creation and to be able to generate a report similar to what you are asking... So whenever we uncover a condition that fails on a subset of adapters, we can create an adapter-specific unit test for it, and it will be included automatically in the report.

    I haven't started looking at this yet.. For now I just have two raw ideas for the implementation - special adapter annotations on unit tests; splitting adapter specific tests into separate directories (with a common directory that has tests that work everywhere). Not sure how easy it will be to extend Surefire Maven plugin to handle those.

    [1] http://svn.apache.org/repos/asf/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/AccessStackAdapter.java

    > Exception for unsupported expression comes too late
    > ---------------------------------------------------
    >
    > Key: CAY-1064
    > URL: https://issues.apache.org/cayenne/browse/CAY-1064
    > Project: Cayenne
    > Issue Type: Bug
    > Environment: MS SQL server and Derby in combination
    > Reporter: Øyvind Harboe
    > Assignee: Andrus Adamchik
    >
    > Cayenne MS SQL adapter does not support likeIgnoreCase for CLOB's(does a JIRA issue exist?).
    > However, the *main* problem is that I tested w/Derby and it worked fine. What I'd like to see is a way to have Derby(or any other database adapter) fail if a feature is not supported on all the adapters.
    > Ideally I'd like to catch this compile time, but if I can catch the use of features which are not supported for a list of adapters I care about during normal smoketesting that will do nicely.
    > at org.apache.tapestry.listener.ListenerMap.invokeTargetMethod(ListenerMap.java:257)
    > ... 29 more
    > Caused by: org.apache.cayenne.CayenneException: [v.3.0-SNAPSHOT May 21 2008 12:37:01] Error getting ResultIterator: Query Exception:
    > java.sql.SQLException: Argument data type text is invalid for argument 1 of upper function.
    > at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:364)
    > at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2754)
    > at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2195)

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Fri Jun 06 2008 - 06:51:23 EDT