Re: Postgresql Blob/LargeObject support in Cayenne

From: Oscar Picasso (oscgoogl..ahoo.com)
Date: Sun Oct 02 2005 - 18:23:49 EDT

  • Next message: Andrus Adamchik: "Re: Postgresql Blob/LargeObject support in Cayenne"

    Below is my debug trace until the Exception.

    As you can see BlobType is not called. The Postgresql
    AbstractJdbc2Statement.setObject has a switch with different java.sql.Types
    cases but none of these cases is Types.Blob.

    I am under the impression that there are two problems:

    1- BlobType.setObject(..) that is not called.
    2- The Postgresql AbstractJdbc2Statement.setObject() doesn't seem to recognize
    Blobs.
    To use blobs I guess we have to explicitly use setBlob instead of setObject. By
    the way in Ibatis I remember to have written a 'TypeHandler' that use setBlob,
    not setObject and it worked.

    Maybe the problem could by solved if:
    - The BlobType.setJdbcObject method were called.
    - Its body would be: st.setBlob(pos, val) instead of setObject(pos, val, type)

    Just a guess.

    <trace>
    Thread [main] (Suspended)
            Jdbc3PreparedStatement(AbstractJdbc2Statement).setObject(int, Object, int,
    int) line: 1663
            Jdbc3PreparedStatement(AbstractJdbc3Statement).setObject(int, Object, int,
    int) line: 1435
            Jdbc3PreparedStatement(AbstractJdbc2Statement).setObject(int, Object, int)
    line: 1669
            DefaultType(AbstractType).setJdbcObject(PreparedStatement, Object, int, int,
    int) line: 92
            PostgresAdapter(JdbcAdapter).bindParameter(PreparedStatement, Object, int,
    int, int) line: 567
            PostgresAdapter.bindParameter(PreparedStatement, Object, int, int, int) line:
    340
            InsertBatchQueryBuilder.bindParameters(PreparedStatement, BatchQuery) line: 99
            BatchAction.runAsIndividualQueries(Connection, BatchQueryBuilder,
    OperationObserver, boolean) line: 213
            BatchAction.performAction(Connection, OperationObserver) line: 118
            DataNodeQueryAction.runQuery(Connection, Query) line: 95
            DataNode.performQueries(Collection, OperationObserver, Transaction) line: 303
            DataContextCommitAction.commit(Level) line: 187
            DataContext.commitChanges(Level) line: 978
            DataContext.commitChanges() line: 948
            BlobDraft.main(String[]) line: 77
    </trace>

    --- Andrus Adamchik <andru..bjectstyle.org> wrote:

    >
    > On Oct 2, 2005, at 5:00 PM, Oscar Picasso wrote:
    >
    > > - on inserts: *NO* BlobType method is called
    >
    > But your stack trace clearly shows AbstractType method invocation:
    >
    > >> at
    > >> org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject
    > >> (AbstractType.java:92)
    > >>
    >
    > What is it calling then? Try putting a breakpoint and execute it in
    > debugger to see exactly what's happening there.
    >
    > Andrus
    >

                    
    __________________________________
    Yahoo! Mail - PC Magazine Editors' Choice 2005
    http://mail.yahoo.com



    This archive was generated by hypermail 2.0.0 : Sun Oct 02 2005 - 18:23:50 EDT