Re: Postgresql Blob/LargeObject support i..[ANOTHER PROBLEM]

From: Oscar Picasso (oscgoogl..ahoo.com)
Date: Mon Oct 03 2005 - 16:16:48 EDT

  • Next message: Andrus Adamchik: "Re: Postgresql Blob/LargeObject support i..[ANOTHER PROBLEM]"

    Hi again,

    I thought that my blobs problems were solved.

    However, if, on inserts, the Blob is null, Cayenne doesn't use the ExtendedType
    and I get again an Exception:

    ...
    Caused by: org.postgresql.util.PSQLException: ERROR: column "content" is of
    type oid but expression is of type bytea
    ...

    It seems Cayenne chose the ExtendedType based on the actual class of the
    DataObject property.

    Wouldn't it be better to use the declared class instead?

    Any other idea? Is there another place where I could tell Cayenne to use 'oid'
    for Blobs, in anycase?

    Oscar

    --- Oscar Picasso <oscgoogl..ahoo.com> wrote:

    > >
    > > is "Blob" a "java.sql.Blob" or your own implementation of this
    > > interface? Doublecheck that it is the former.
    > >
    >
    > It works if I do the following:
    >
    > 1- BlobType.getClassName returns <WhateverMyCustomBlob>.class.getName()
    > instead
    > of java.sql.Blob.class.getName(). (Reading the code I saw that it use the
    > real
    > class name as the key).
    >
    > 2-In BlobType.setJdbcObject ==> use st.setBlob(...) instead of
    > st.setObject(...).
    >
    > Thanks for your help, I really appreciated.
    >
    > By the way, compared to other persistence frameworks, I am really pleased
    > with
    > what I have found so far in Cayenne.
    >
    > Especially now that I have solved my Blobs problems.
    >
    > For my pleasure to be complete I have still to figure out how to do a couple
    > of
    > things but I think I am on the right track.
    >
    > Have a nice evening (?).
    >
    > Oscar
    >
    >
    >
    > __________________________________
    > Yahoo! Mail - PC Magazine Editors' Choice 2005
    > http://mail.yahoo.com
    >

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



    This archive was generated by hypermail 2.0.0 : Mon Oct 03 2005 - 16:16:50 EDT