pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
problem with getBytes
5+ messages / 2 participants
[nested] [flat]

* problem with getBytes
@ 1999-11-22 17:25 Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
  0 siblings, 0 replies; 5+ messages in thread

From: Rafal Piotrowski (CSCS) @ 1999-11-22 17:25 UTC (permalink / raw)
  To: pgsql-interfaces

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?

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) :-(

thanks,

RP

P.S. Replay to my email address, please.
-- 
..............................................................................
:           Rafal Piotrowski             :
mailto:Rafal.Piotrowski@CSCS.CH   :
:          Research Scientist            :
http://www.cscs.ch/~rpiotrow      :
: Centro Svizzero di Calcolo Scientifico : Tel.: +41 (0)91 610
8211          :
:       Via Cantonale, Galleria 2        :       +41 (0)91 610 8315
(direct) :
:       CH-6928 Manno, Switzerland       : Fax:  +41 (0)91 610
8383          :
..............................................................................

Attachments:

Rafal.Piotrowski.vcf (text/x-vcard, 469B) download begin:vcard n:Piotrowski;Rafal tel;cell:+41 (0)78 621 6366 tel;fax:+41 (0)91 610 8383 tel;work:+41 (0)91 610 8315 x-mozilla-html:TRUE url:http://www.cscs.ch/~rpiotrow org:Centro Svizzero di Calcolo Scientifico;Software Engineering version:2.1 email;internet:Rafal.Piotrowski@CSCS.CH title:Research Scientist note:ICQ# 23522302 adr;quoted-printable:;;Via Cantonale - Galleria 2,=0D=0A;Manno;Ticino;CH-6928;Switzerland x-mozilla-cpt:;-21728 fn:Rafal Piotrowski end:vcard
^ permalink raw reply [nested|flat] 5+ messages in thread

* problem with getBytes
@ 1999-11-22 18:10 Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
  1999-11-22 19:28 ` Re: [INTERFACES] problem with getBytes Peter Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 5+ messages in thread

From: Rafal Piotrowski (CSCS) @ 1999-11-22 18:10 UTC (permalink / raw)
  To: pgsql-interfaces

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?

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) :-(

thanks,

RP

P.S. Replay to my email address, please.
-- 
..............................................................................
:           Rafal Piotrowski             :
mailto:Rafal.Piotrowski@CSCS.CH   :
:          Research Scientist            :
http://www.cscs.ch/~rpiotrow      :
: Centro Svizzero di Calcolo Scientifico : Tel.: +41 (0)91 610
8211          :
:       Via Cantonale, Galleria 2        :       +41 (0)91 610 8315
(direct) :
:       CH-6928 Manno, Switzerland       : Fax:  +41 (0)91 610
8383          :
..............................................................................



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] problem with getBytes
  1999-11-22 18:10 problem with getBytes Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
@ 1999-11-22 19:28 ` Peter Mount <peter@retep.org.uk>
  1999-11-23 08:47   ` Re: [INTERFACES] problem with getBytes Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Mount @ 1999-11-22 19:28 UTC (permalink / raw)
  To: Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>; +Cc: 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/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] problem with getBytes
  1999-11-22 18:10 problem with getBytes Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
  1999-11-22 19:28 ` Re: [INTERFACES] problem with getBytes Peter Mount <peter@retep.org.uk>
@ 1999-11-23 08:47   ` Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
  1999-11-23 20:43     ` Re: [INTERFACES] problem with getBytes Peter Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 5+ messages in thread

From: Rafal Piotrowski (CSCS) @ 1999-11-23 08:47 UTC (permalink / raw)
  To: Peter Mount <peter@retep.org.uk>; +Cc: pgsql-interfaces

Peter Mount wrote:
> 
> > 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.
> 

I don't want to use the LargeObject API, because I want to make my
application easy to port to different DBMS. And since LargeObject API is
not in for example in JDBC for mySQL, I don't want to use it. 

Anyway, I have used it before, and I have noticed the following thing:
when I store an object, and then try to rewrite the object (the new
object is bigger), nothing huppens. Well, the size of the object
changes, but when I retreive the data from the object, it is unchanged
:-? (i.e. I get the original object, the first one stored).
I thing that is odd. Something simmilar huppens, when I reduce the size
of the object and write it. Except that the size of the LargeObject does
not change, it staies the same, as it was.

Do you have any idea, what is going on?

thanks,

RP
-- 
..............................................................................
:           Rafal Piotrowski             :
mailto:Rafal.Piotrowski@CSCS.CH   :
:          Research Scientist            :
http://www.cscs.ch/~rpiotrow      :
: Centro Svizzero di Calcolo Scientifico : Tel.: +41 (0)91 610
8211          :
:       Via Cantonale, Galleria 2        :       +41 (0)91 610 8315
(direct) :
:       CH-6928 Manno, Switzerland       : Fax:  +41 (0)91 610
8383          :
..............................................................................



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] problem with getBytes
  1999-11-22 18:10 problem with getBytes Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
  1999-11-22 19:28 ` Re: [INTERFACES] problem with getBytes Peter Mount <peter@retep.org.uk>
  1999-11-23 08:47   ` Re: [INTERFACES] problem with getBytes Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
@ 1999-11-23 20:43     ` Peter Mount <peter@retep.org.uk>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Mount @ 1999-11-23 20:43 UTC (permalink / raw)
  To: Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>; +Cc: pgsql-interfaces

On Tue, 23 Nov 1999, Rafal Piotrowski (CSCS) wrote:

> Peter Mount wrote:
> > 
> > > 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.
> > 
> 
> I don't want to use the LargeObject API, because I want to make my
> application easy to port to different DBMS. And since LargeObject API is
> not in for example in JDBC for mySQL, I don't want to use it. 

Thats a good point.

> Anyway, I have used it before, and I have noticed the following thing:
> when I store an object, and then try to rewrite the object (the new
> object is bigger), nothing huppens. Well, the size of the object
> changes, but when I retreive the data from the object, it is unchanged
> :-? (i.e. I get the original object, the first one stored).
> I thing that is odd. Something simmilar huppens, when I reduce the size
> of the object and write it. Except that the size of the LargeObject does
> not change, it staies the same, as it was.

That sounds like a problem in the backend - unless a new lo is created,
but your code is refering to the old one.

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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~1999-11-23 20:43 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-11-22 17:25 problem with getBytes Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
1999-11-22 18:10 problem with getBytes Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
1999-11-22 19:28 ` Peter Mount <peter@retep.org.uk>
1999-11-23 08:47   ` Rafal Piotrowski (CSCS) <Rafal.Piotrowski@CSCS.CH>
1999-11-23 20:43     ` Peter Mount <peter@retep.org.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox