Re: WARN: DefaultResultIterator: Error Bad Integer Dude?

From: Mike Block (mbloc..ac.com)
Date: Wed Dec 10 2003 - 15:54:22 EST

  • Next message: Andrus Adamchik: "Re: WARN: DefaultResultIterator: Error Bad Integer Dude?"

    Thanks!

    The DB column (shortDescription) is a "bytea" and the model was a BLOB
    from the popup.
    Using the:
            pg74jdbc3.jar
    Tried:
            pg73jdbc3.jar AND pg73jdbc2.jar

    [Note: these were d/l, not compiled locally since I'm accessing a
    remote PG database on a different platform:
            local Mac OSX
            remote: debian (x86)
    ]

    So I change it to text and CLOB; verified that the generated SQL
    creates a column of type text (yep!). Rebuilt from scratch..

    It looks as if PG is complaining about the type not knowing about:
                    org.postgresql.util.PSQLException: Unknown Types value.
    The stack:

          [java] cayenne DEBUG [main 12-10 15:07:25] DefaultConfiguration:
    didInitialize finished.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: --- will
    run 1 query.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: Opening
    connection: jdbc:postgresql://gump.visualtech.com/blickman-de
    v
          [java] Login: blickman
          [java] Password: *******
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: +++
    Connecting: SUCCESS.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: SELECT
    t0.name, t0.id FROM public.measurement t0 - prepared in 35 ms.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: ===
    returned 1 row. - took 64 ms.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: --- will
    run 1 query.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: SELECT
    t0.extension, t0.mime_info, t0.name, t0.id FROM public.documen
    t_type t0
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: ===
    returned 3 rows. - took 5 ms.
          [java] **** testNewProduct ****
          [java] **** Making a new Product
          [java] **** P: {[ modelNumber => model 1
          [java] partNumber => p/n 1
          [java] externDocs =>
    (org.objectstyle.cayenne.access.ToManyList)
          [java] shortDescription => [..ab00e
          [java] listPricePpd =>
    39.9500000000000028421709430404007434844970703125
          [java] listPriceAbs =>
    29.949999999999999289457264239899814128875732421875
          [java] toProductFamilies =>
    (org.objectstyle.cayenne.access.ToManyList)
          [java] prod_to_PPF =>
    (org.objectstyle.cayenne.access.ToManyList)
          [java] ]<oid: com.dci.blickman.blickmanDB.catalog.Product (temp):
    ; state: new>}

          [java] **** Done!
          [java] **** P <<==> M !
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: --- will
    run 1 query.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: SELECT
    t0.dimension, t0.image, t0.list_price_abs, t0.list_price_ppd,
    t0.model_number, t0.modified_date, t0.part_number,
    t0.short_description, t0.weight, t0.id, t0.measeurement_id FROM
    public.product
    t0 WHERE t0.measeurement_id = ? [bind: 1] - prepared in 12 ms.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: ===
    returned 4 rows. - took 40 ms.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: --- will
    run 1 query.
          [java] **** Done!
          [java] **** Getting Carts PF
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: SELECT
    t0.image, t0.modified_date, t0.name, t0.product_family_cd, t0.
    id, t0.parent_id FROM public.product_family t0 WHERE t0.name = ? [bind:
    'Carts']
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: ===
    returned 1 row. - took 18 ms.
          [java] **** Done!
          [java] **** P<<===>>PF (cart)!
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: --- will
    run 1 query.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: SELECT
    DISTINCT t0.dimension, t0.image, t0.list_price_abs, t0.list_pr
    ice_ppd, t0.model_number, t0.modified_date, t0.part_number,
    t0.short_description, t0.weight, t0.id, t0.measeurement_id FROM public
    .product t0, public.product_product_family t1 WHERE t0.id =
    t1.product_id AND (t1.product_family_id = ?) [bind: 3]
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: ===
    returned 1 row. - took 22 ms.
          [java] **** Done!
          [java] **** Saving...!
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: --- will
    run 2 queries.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: SELECT
    NEXT_ID FROM AUTO_PK_SUPPORT WHERE TABLE_NAME = 'product'
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: ===
    returned 1 row. - took 18 ms.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: UPDATE
    AUTO_PK_SUPPORT SET NEXT_ID = NEXT_ID + 20 WHERE TABLE_NAME =
    'product'
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: ===
    updated 1 row.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: +++
    transaction committed.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: --- will
    run 2 queries.
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: INSERT
    INTO public.product (dimension, id, image, list_price_abs, lis
    t_price_ppd, measeurement_id, model_number, modified_date, part_number,
    short_description, weight) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
      ?, ?, ?)
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: [bind:
    NULL, 540, NULL, 29.949999999999999289457264239899814128875732
    421875, 39.9500000000000028421709430404007434844970703125, 1, 'model
    1', NULL, 'p/n 1', < 70 2F 6E 20 31 20 2D 2D 20 6D 6F 64 65 6
    C 20 31 >, NULL]
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: *** error.
          [java] org.postgresql.util.PSQLException: Unknown Types value.
          [java] at
    org.postgresql.jdbc1.AbstractJdbc1Statement.setObject(AbstractJdbc1State
    ment.java:1670)
          [java] at
    org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3State
    ment.java:1370)
          [java] org.objectstyle.cayenne.CayenneRuntimeException: [v.1.0.3
    November 16 2003] Raising from underlyingQueryEngine excepti
    on.
          [java] at
    org.postgresql.jdbc1.AbstractJdbc1Statement.setObject(AbstractJdbc1State
    ment.java:1676)
          [java] at
    org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(Abstract
    Type.java:78)
          [java] at
    org.objectstyle.cayenne.access.util.ContextCommitObserver.nextGlobalExce
    ption(ContextCommitObserver.java:188)
          [java] at
    org.objectstyle.cayenne.access.types.ByteArrayType.setJdbcObject(ByteArr
    ayType.java:171)
          [java] at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:349
    )
          [java] at
    org.objectstyle.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:4
    38)
          [java] at
    org.objectstyle.cayenne.access.ContextCommit.commit(ContextCommit.java:1
    88)
          [java] at
    org.objectstyle.cayenne.access.trans.BatchQueryBuilder.bindParameters(Ba
    tchQueryBuilder.java:143)
          [java] at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.jav
    a:764)
          [java] at
    org.objectstyle.cayenne.access.DataNode.runBatchUpdateAsIndividualQuerie
    s(DataNode.java:567)
          [java] at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.jav
    a:738)
          [java] at
    com.dci.blickman.blickmanDB.test.PandMTest.testNewProduct(Unknown
    Source)
          [java] at
    org.objectstyle.cayenne.access.DataNode.runBatchUpdate(DataNode.java:477
    )
          [java] at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:287
    )
          [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
          [java] at
    org.objectstyle.cayenne.access.ContextCommit.commit(ContextCommit.java:1
    88)
          [java] at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
    a:39)
          [java] at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
    Impl.java:25)
          [java] at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.jav
    a:764)
          [java] at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.jav
    a:738)
          [java] at java.lang.reflect.Method.invoke(Method.java:324)
          [java] at junit.framework.TestCase.runTest(TestCase.java:154)
          [java] at
    com.dci.blickman.blickmanDB.test.PandMTest.testNewProduct(Unknown
    Source)
          [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
          [java] at junit.framework.TestCase.runBare(TestCase.java:127)
          [java] at
    junit.framework.TestResult$1.protect(TestResult.java:106)
          [java] at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
    a:39)
          [java] at
    junit.framework.TestResult.runProtected(TestResult.java:124)
          [java] at junit.framework.TestResult.run(TestResult.java:109)
          [java] at junit.framework.TestCase.run(TestCase.java:118)
          [java] at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
    Impl.java:25)
          [java] at java.lang.reflect.Method.invoke(Method.java:324)
          [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
          [java] at junit.framework.TestCase.runTest(TestCase.java:154)
          [java] at junit.framework.TestSuite.run(TestSuite.java:203)
          [java] at junit.framework.TestCase.runBare(TestCase.java:127)
          [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
          [java] at
    junit.framework.TestResult$1.protect(TestResult.java:106)
          [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
          [java] at
    junit.framework.TestResult.runProtected(TestResult.java:124)
          [java] at junit.framework.TestResult.run(TestResult.java:109)
          [java] at junit.textui.TestRunner.run(TestRunner.java:72)
          [java] at
    com.dci.blickman.blickmanDB.test.PandMTest.main(Unknown Source)
          [java] at junit.framework.TestCase.run(TestCase.java:118)
          [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
          [java] Caused by: org.postgresql.util.PSQLException: Unknown Types
    value.
          [java] at
    org.postgresql.jdbc1.AbstractJdbc1Statement.setObject(AbstractJdbc1State
    ment.java:1670)
          [java] at junit.framework.TestSuite.run(TestSuite.java:203)
          [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
          [java] at
    org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3State
    ment.java:1370)
          [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
          [java] at junit.textui.TestRunner.run(TestRunner.java:72)
          [java] at
    org.postgresql.jdbc1.AbstractJdbc1Statement.setObject(AbstractJdbc1State
    ment.java:1676)
          [java] at
    com.dci.blickman.blickmanDB.test.PandMTest.main(Unknown Source)
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: *** error.
          [java] org.postgresql.util.PSQLException: Unknown Types value.
          [java] at
    org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(Abstract
    Type.java:78)
          [java] at
    org.postgresql.jdbc1.AbstractJdbc1Statement.setObject(AbstractJdbc1State
    ment.java:1670)
          [java] at
    org.objectstyle.cayenne.access.types.ByteArrayType.setJdbcObject(ByteArr
    ayType.java:171)
          [java] at
    org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3State
    ment.java:1370)
          [java] at
    org.objectstyle.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:4
    38)
          [java] at
    org.postgresql.jdbc1.AbstractJdbc1Statement.setObject(AbstractJdbc1State
    ment.java:1676)
          [java] at
    org.objectstyle.cayenne.access.trans.BatchQueryBuilder.bindParameters(Ba
    tchQueryBuilder.java:143)
          [java] at
    org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(Abstract
    Type.java:78)
          [java] at
    org.objectstyle.cayenne.access.DataNode.runBatchUpdateAsIndividualQuerie
    s(DataNode.java:567)
          [java] at
    org.objectstyle.cayenne.access.types.ByteArrayType.setJdbcObject(ByteArr
    ayType.java:171)
          [java] at
    org.objectstyle.cayenne.access.DataNode.runBatchUpdate(DataNode.java:477
    )
          [java] at
    org.objectstyle.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:4
    38)
          [java] at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:287
    )
          [java] at
    org.objectstyle.cayenne.access.trans.BatchQueryBuilder.bindParameters(Ba
    tchQueryBuilder.java:143)
          [java] ... 20 more
          [java] **** tearDown ****
          [java] at
    org.objectstyle.cayenne.access.DataNode.runBatchUpdateAsIndividualQuerie
    s(DataNode.java:567)
          [java] at
    org.objectstyle.cayenne.access.DataNode.runBatchUpdate(DataNode.java:477
    )
          [java] at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:287
    )
          [java] at
    org.objectstyle.cayenne.access.ContextCommit.commit(ContextCommit.java:1
    88)
          [java] at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.jav
    a:764)
          [java] at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.jav
    a:738)
          [java] at
    com.dci.blickman.blickmanDB.test.PandMTest.testNewProduct(Unknown
    Source)
          [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
          [java] at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
    a:39)
          [java] at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
    Impl.java:25)
          [java] at java.lang.reflect.Method.invoke(Method.java:324)
          [java] at junit.framework.TestCase.runTest(TestCase.java:154)
          [java] at junit.framework.TestCase.runBare(TestCase.java:127)
          [java] at
    junit.framework.TestResult$1.protect(TestResult.java:106)
          [java] at
    junit.framework.TestResult.runProtected(TestResult.java:124)
          [java] at junit.framework.TestResult.run(TestResult.java:109)
          [java] at junit.framework.TestCase.run(TestCase.java:118)
          [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
          [java] at junit.framework.TestSuite.run(TestSuite.java:203)
          [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
          [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
          [java] at junit.textui.TestRunner.run(TestRunner.java:72)
          [java] at
    com.dci.blickman.blickmanDB.test.PandMTest.main(Unknown Source)
          [java] cayenne INFO [main 12-10 15:07:25] QueryLogger: ***
    transaction rolled back.

    On Wednesday, December 10, 2003, at 03:12 PM, Andrus Adamchik wrote:

    > I will need to do more testing of LOBs on Postgres. Just to make sure,
    > what column type did you use for the blob? Was it "bytea"?
    >
    > Also since you've mentioned that the attribute in question is a
    > string, I guess your best bet is "text" column (CLOB in JDBC spec),
    > instead of "bytea" (BLOB).
    >
    > Andrus
    >
    >
    > On Dec 10, 2003, at 2:39 PM, Mike Block wrote:
    >
    >> I'm using pg73jdbc3.jar from http://jdbc.postgresql.org/download.html
    >> Tried pg74jdbc3.jar and pg73jdbc2.jar with the same errors.
    >>
    >> In the short term, I can make it a really big varchar since it is
    >> just a short description field.
    >>
    >> Thanks,
    >> -[]
    >>
    >> On Wednesday, December 10, 2003, at 01:15 PM, Andrus Adamchik wrote:
    >>
    >>> Looks like the problem is in handling the BLOB column. Did you
    >>> upgrade JDBC driver recently?
    >>>
    >>>> [java] Bad Integer Dude?
    >>>> [java] at
    >>>> org.postgresql.jdbc1.AbstractJdbc1ResultSet.toInt(AbstractJdbc1Resul
    >>>> tSet.java:700)
    >>>
    >>> ... PostgreSQL drivers errors are so personal :-)
    >>>
    >>> Andrus
    >>>
    >>>
    >>>
    >> -[]
    >> Digital Color Image
    >> Phone: 856-662-5532
    >
    >
            -[]
    Digital Color Image
    Phone: 856-662-5532



    This archive was generated by hypermail 2.0.0 : Wed Dec 10 2003 - 15:54:26 EST