[OS-JIRA] Created: (CAY-251) NPE on calling stored proc for SQL Server

From: jir..bjectstyle.org
Date: Tue Dec 21 2004 - 19:57:01 EST

  • Next message: Derek Rendall: "Safer version of IncrementalFaultList.DataRowListHelper"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-251

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-251
        Summary: NPE on calling stored proc for SQL Server
           Type: Bug

         Status: Assigned
       Priority: Major

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Versions:
                 1.1

       Assignee: Andrus Adamchik
       Reporter: Steve Wells

        Created: Tue, 21 Dec 2004 7:56 PM
        Updated: Tue, 21 Dec 2004 7:56 PM
    Environment: SQL 2000 (V8 SP3) on Windows 2000 SP3 and Windows XP SP2

    Description:
    (Sample code at bottom)

    Has anyone had luck using stored proc with SQL 2K (V8 SP3)? I get this
    > using the full release Cayenne 1.1:
    >
    > 297 [main] INFO access.QueryLogger - --- will run 1 query.
    > 297 [main] INFO access.QueryLogger - Opening connection:
    > jdbc:microsoft:sqlserver://xxxx;databaseName=xxx;SelectMethod=cursor
    > Login: xxx
    > Password: *******
    > 500 [main] INFO access.QueryLogger - +++ Connecting: SUCCESS.
    > 531 [main] INFO access.QueryLogger - --- transaction started.
    > 625 [main] INFO access.QueryLogger - {? = call dbo.dms_maint_CCGet}
    > [bind: '[OUT]']
    > 953 [main] INFO access.QueryLogger - === returned 1 row. - took 16 ms.
    > 953 [main] INFO access.QueryLogger - *** error.
    > java.lang.NullPointerException
    > at
    > org.objectstyle.cayenne.access.util.ResultDescriptor.createDescriptor(R
    > esultDescriptor.java:111)
    > at
    > org.objectstyle.cayenne.access.trans.ProcedureTranslator.getResultDescr
    > iptor(ProcedureTranslator.java:178)
    > at
    > org.objectstyle.cayenne.access.DataNode.runStoredProcedure(DataNode.jav
    > a:654)
    > at
    > org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:
    > 345)
    > at
    > org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.jav
    > a:654)
    > at
    > org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.j
    > ava:1408)
    > at
    > org.objectstyle.cayenne.access.Transaction.performQueries(Transaction.j
    > ava:179)
    > at
    > org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.j
    > ava:1366)
    > at
    > org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.jav
    > a:1622)
    > at
    > org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.jav
    > a:1485)
    > at com.riotinto.test.TestDB.main(TestDB.java:35)
    >
    > I've also tried the SelectMethod=direct
    >
    > It seems the line DataNode.java:640
    > boolean hasResultSet = statement.execute();
    > returns true but the resultset is null but should have 100 or so in it.
    > Its the resultset in ResultDescriptor that is null and throwing the
    > npe.
    >
    > I've tried calling a few different procedures with and without params
    > and get the same result.
    >
    > I have used the same drivers before to call procs via direct JDBC with
    > no problems. I didnt use OUT params and called resultset =
    > statement.executeQuery().

    ----------------------------------------
    Stored Proc:

    CREATE PROCEDURE CCGet AS

    SELECT DISTINCT *
    FROM CurrencyCode
    GO
    ----------------------------------------
    Table Def:
    CREATE TABLE [CurrencyCode] (
            [Currency_Code] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
            [Currency_Text] [char] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
            [Country_Code] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
            CONSTRAINT [PK_CurrencyCode] PRIMARY KEY CLUSTERED
            (
                    [Currency_Code]
            ) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    ----------------------------------------
    Sample Data:
    AUD,Australian Dollar ,AU
    AWG,Aruban Guilder ,AW
    AZM,Azerbaijan Manat ,AZ
    BAD,Bosnia-Herzogovinian Dinar ,BA

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Tue Dec 21 2004 - 19:57:03 EST