NPE calling SQL Server 2K Stored Procedure

From: Steve Wells (stwell..wnmail.net)
Date: Wed Dec 08 2004 - 01:57:12 EST

  • Next message: Pepe Perez: "Re: DataContext XML serialization"

    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(ResultDescriptor.java:111)
            at org.objectstyle.cayenne.access.trans.ProcedureTranslator.getResultDescriptor(ProcedureTranslator.java:178)
            at org.objectstyle.cayenne.access.DataNode.runStoredProcedure(DataNode.java:654)
            at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:345)
            at org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.java:654)
            at org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.java:1408)
            at org.objectstyle.cayenne.access.Transaction.performQueries(Transaction.java:179)
            at org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.java:1366)
            at org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1622)
            at org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java: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().

    BTW re-engineering to get the procs worked a treat. :)

    Thanks,

    Steve



    This archive was generated by hypermail 2.0.0 : Wed Dec 08 2004 - 01:57:13 EST