help: fastpath error! - Mailing list pgsql-jdbc

From M. Dietrich
Subject help: fastpath error!
Date
Msg-id 20020506134350.GE3762@emdete.de
Whole thread Raw
List pgsql-jdbc
hi everyone!

i get still those fastpath errors with the jdbc drivers. i tested the
driver installed with debian, the stable and the development driver
from jdbc.postgresql.org. has anybody else the same problem?

i use blobs alot. using blobs with pg-sql's jdbc does not work
strait-forward in a jdbc-manner like this:

    statement.setBinaryStream(4, in, size);

even this does not work:

    byte buffer[] = new byte[(int)size];
        in.read(buffer);
        statement.setBytes(4, buffer);


so this one is what i found out works best for me:

    org.postgresql.largeobject.LargeObjectManager lom =
((org.postgresql.Connection)getConnection()).getLargeObjectAPI();
    int loid = lom.create();
    org.postgresql.largeobject.LargeObject blob = lom.open(loid);
    int s;
    byte buf[] = new byte[2048];
        while ((s = in.read(buf, 0, buf.length)) > 0)
            blob.write(buf, 0, s);
        blob.close();
    java.sql.Blob b = new org.postgresql.largeobject.PGblob((org.postgresql.Connection)getConnection(), loid);
        statement.setBlob(4, b);

but using this i get the fast-path error. using the other versions
results in a errormessage containing all the binary data.

best regards,

    michael

pgsql-jdbc by date:

Previous
From: "Jerry Jalenak"
Date:
Subject: JDBC Driver JAR Files
Next
From: Dave Cramer
Date:
Subject: Re: JDBC Driver JAR Files