Re: [INTERFACES] problem with getBytes - Mailing list pgsql-interfaces

From Peter Mount
Subject Re: [INTERFACES] problem with getBytes
Date
Msg-id Pine.LNX.4.10.9911221926540.19044-100000@maidast.retep.org.uk
Whole thread Raw
In response to problem with getBytes  ("Rafal Piotrowski (CSCS)" <Rafal.Piotrowski@CSCS.CH>)
List pgsql-interfaces
On Mon, 22 Nov 1999, Rafal Piotrowski (CSCS) wrote:

> Hi,
> 
> Configuration:
> - PostgreSQL 6.5.1
> - JDBC for JDK 1.2
> 
> Problem:
> 
> I have a table which looks like this:
> -------+-----------+---------------+---------------+--------------+------------
> id:int | name:text | language:text | filename:text | comment:text |
> content:oid
> -------+-----------+---------------+---------------+--------------+------------
>  1     |a name     |English        |a file name    |             
> |1102724
> -------+-----------+---------------+---------------+--------------+------------
> The problem starts when I use getBytes("content"). I am getting the
> following error:
>   FastPath call returned ERROR:  lo_tell: invalid large object
> descriptor (0)
> So, as you can see the oid is not zero. Does anyone know what is going
> on?

As of 6.5, you must setAutoCommit(false) before using large objects. This
is because the backend now requires an open Transaction for them.

> One more thing, setBytes method, does work, but only if the array of
> bytes is not too big. (I don't know the exact size) :-(

You may need to look at the LargeObject api, which is additional to the
JDBC api.

Peter

--      Peter T Mount peter@retep.org.uk     Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgresJava PDF Generator: http://www.retep.org.uk/pdf



pgsql-interfaces by date:

Previous
From: "Rafal Piotrowski (CSCS)"
Date:
Subject: problem with getBytes
Next
From: Peter Mount
Date:
Subject: Re: [INTERFACES] table very big !!!!!