Re: LargeObject problems (more INFO) - Mailing list pgsql-jdbc

From Gustavo Muñoz
Subject Re: LargeObject problems (more INFO)
Date
Msg-id 3E5A493A.5090900@interware.com.mx
Whole thread Raw
In response to Re: Field BLOB  ("Dirk Bromberg" <bromberg@tzi.de>)
List pgsql-jdbc
Hi

I posted this yesterday, but got no response, maybe the subject wasn't very descriptive or I didn't provide some key information.

I'm using Windows 2000 Server in English, and Sun  JDK 1.4.1_01.
Postgres' version is 7.3.2.
I read the documentation,
And I did the things exactly as indicated, but my problem is that the LargeObject modifies my data: it keeps the same number of bytes, but they differ. And with the strict-JBDC API, I get an OutOfMemoryError. On this, I know that Postgres crew say this method consumes a lot of memory, but I'm trying to store 10Mb and set Xmx jvm flag very large and always fails.

Maybe someone from TeamB, knows something about encoding problems (target LargeObject method). I expected Postgres just to store de bytes as they were given, in order to be able to retrive them untouched
Maybe I'm not using the right driver. I'm using the driver that is distribuited with cygwin.
I'm going to test this exact code, in Linux.
Next step is to debug the source code. But before doing that I want to be sure I'm doing the right steps.




Here is my original post:
I have inserted a LargeObject using LargeObject Postgres API but when I get back the bytes they are changed in some way. For instance, if I insert the bytes of a zip or a jpg file (and the files are ok, because I can view the contents) when I retrieve the bytes from the database and create new files with the bytes, the original files and the new ones differ. They contain the same number of bytes, but they differ. No longer winzip or iexplorer open the new files, and diff says the files differ.
I'm using windows version of postgres, and jdk1.4.1_01
The field's data type is oid, of course

By the way, if I use the JDBC standard API (setBytes o setBinaryStream using bytea) I get an OutOfMemoryError with files with size equals or larger than 10Mb.

Dirk Bromberg wrote:
see in the documentation
 
 
 
-----Ursprüngliche Nachricht-----
Von: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] Im Auftrag von carloszaparoli
Gesendet: Montag, 24. Februar 2003 13:38
An: pgsql-jdbc@postgresql.org
Betreff: [JDBC] Field BLOB

I need include a field BLOB.
 
Who???
 
Carlos Zaparoli        (__)]
Business Analyst
Zaparoli Information Technology

pgsql-jdbc by date:

Previous
From: Felipe Schnack
Date:
Subject: calling PreparedStatment.toString()
Next
From: Barry Lind
Date:
Subject: Re: case problem with moveToInsertRow() - 7.4dev drivers OK,