Problem getting long value from stored procedure (cursor)

From: Pirola Davide (davide.pirol..tin.it)
Date: Wed Jun 22 2005 - 11:16:16 EDT

  • Next message: Mike Kienenberger: "Weird classpath issue using DefaultConfiguration during unit testing"

    Hi,
    i have a problem.
    i have a store procedure that return this kind of data:

    CONTAINERID CONTAINERNAME CONTENTID
    3 samsung -9999990000
    6385 samsungcalendari -9999990013

    i have mapped this cursor of data (in datamap.xml) in that manner:

    <obj-entity name="Container" readOnly="true" className="it.telecomitalia.rossoalice.cntman.types.ContainerImpl" dbEntityName="CONTAINER">
                    <obj-attribute name="id" type="java.lang.Long" db-attribute-path="CONTAINERID" />
                    <obj-attribute name="name" type="java.lang.String" db-attribute-path="CONTAINERNAME" />
                    <obj-attribute name="contentId" type="java.lang.Long" db-attribute-path="CONTENTID" />
    </obj-entity>

    When i execute the stored procedure i obtain this exception:

    6590 [main] INFO org.objectstyle.cayenne.access.QueryLogger - +++ Connecting: SUCCESS.
    6605 [main] INFO org.objectstyle.cayenne.access.QueryLogger - {call alwos01.UTL_SPECIALI.ContainerSearch(?, ?, ?, ?, ?)} [bind: NULL, 'samsung', '[OUT]', '[OUT]', '[OUT]']
    7028 [main] INFO org.objectstyle.cayenne.access.QueryLogger - *** error.
    java.sql.SQLException: Overflow numerico
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
            at oracle.jdbc.driver.OracleStatement.getIntValue(OracleStatement.java:4489)
            at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:536)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.objectstyle.cayenne.access.types.DefaultType.materializeObject(DefaultType.java:243)
            at org.objectstyle.cayenne.access.DefaultResultIterator.readDataRow(DefaultResultIterator.java:250)
            at org.objectstyle.cayenne.access.DefaultResultIterator.nextDataRow(DefaultResultIterator.java:194)
            at org.objectstyle.cayenne.access.DefaultResultIterator.dataRows(DefaultResultIterator.java:224)
            at org.objectstyle.cayenne.access.DataNode.readResultSet(DataNode.java:730)
            at org.objectstyle.cayenne.dba.oracle.OracleDataNode.readStoredProcedureOutParameters(OracleDataNode.java:145)
            at org.objectstyle.cayenne.access.DataNode.runStoredProcedure(DataNode.java:644)
            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:1463)
            at it.telecomitalia.rossoalice.cntman.loaders.generic.GenericLoader.getTypesFromCursor(GenericLoader.java:245)
            ......
            .....
            ....

    The error is caused by a number contained in a last column (CONTENTID).
    This is greater than the max value of a Integer... buy i have mapped this field with java.lang.Long... so i don't understand why Cayenne try to read this in that manner "...OracleResultSetImpl.getInt...".

    Anyone can help me?

    Than's
    Davide



    This archive was generated by hypermail 2.0.0 : Wed Jun 22 2005 - 11:12:22 EDT