openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MiƂosz Tylenda <mtyle...@o2.pl>
Subject Re: exact point when DB updates
Date Sun, 01 Mar 2009 10:42:54 GMT
Hi Oleg,

OpenJPA does not currently ship with a dictionary for Ingres. Have you written your own?

I am currently working on an update for Firebird dictionary and had a glance on how BLOB stuff
works. It looks like various code paths are taken depending on how you annotate your BLOB.

If you use BLOB streaming (for examples, see test classes and entities in org.apache.openjpa.jdbc.meta.strats
package, test directory) the methods like insertBlobForStreamingLoad and updateBlob from DBDictionary
are called.

If you use BLOBs in the JPA-compliant way, e.g.:

    @Lob
    public byte[] getBlobin() {
        return blobin;
    }
    public void setBlobin(byte[] blob) {
        this.blobin = blob;
    }

then the following DBDictionary properties affect how the BLOB is handled:

    public boolean useGetBytesForBlobs = false;
    public boolean useSetBytesForBlobs = false;
    public boolean useGetObjectForBlobs = false;

A good point to start is to set

        useGetBytesForBlobs = true;
        useSetBytesForBlobs = true;

in your database dictionary and see what happens.

A similar behaviour applies to CLOBs. You can look into the source, mainly DBDictionary and
LobFieldStrategy, to get the very details, if you haven't looked yet.

Hope I haven't missed anything and this helps,
Milosz


> Hi
> 
> I'm working with Ingres DB and have experienced some problems with during
> update of an entity with BLOB. Our platform tested and works with several
> DBMS, such as MySQL, Derby, Oracle, Postgres, Sybase. We use both Hibernate
> and OpenJPA (versions 1.1.0 and 1.3.0).
> 
> The problem with BLOBs on Ingres comes out when application tries to insert
> or update new entity with one BLOB field. At first we thought the problem is
> in Ingres JDBC because it does not support scrollable ResultSet when result
> contains a BLOB field. But looks like OpenJPA does not need scrollable
> cursor for updates. I have compared runtime with MySQL and I as far as I
> could see forward, read-only ResultSets are used there.
> 
> My question would be: where in OpenJPA code the real update (insert) to DB
> is called? How it designed to work with BLOBs (through OutputStream,
> java.sql.Blob)?
> 
> Thank you,
> -Oleg Zenzin
> 

Mime
View raw message