Thread: JDBC - error reading BLOBs

JDBC - error reading BLOBs

From
Nelson Ferreira Jr
Date:
Hi,
 I got the following error when reading BLOBs from a database.
Everything
works fine when there is a few concurrent requests, but when putting the

servlet in a heavy-load situation, I got the following errors:

ERROR:  lo_tell: invalid large object descriptor (0)
ERROR:  lo_close: invalid large obj descriptor (1)
ERROR:  lo_read: invalid large obj descriptor (1)
ERROR:  lo_lseek: invalid large obj descriptor (1)
 It only happens with 10 or more concurrent requests, and about 5% of
the
requests fails. Here is the code:



--------------------------------------------------------------------  con.setAutoCommit(false)  pstmt
=con.prepareStatement(query_gif); ResultSet rs_gif = pstmt.executeQuery();
 
  if (rs_gif.next()) {      BufferedInputStream gifDados = new      BufferedInputStream(rs_gif.getBinaryStream("GIF"));
    byte[] buf =new byte[4*1024]; //4Kb buffer      int tam;      while ((tam =gifDados.read(buf,0,buf.length)) != -1){
        out.write(buf,0,tam); // Its the PrintWriter of my Servlet      }     }     con.setAutoCommit(true);
 

--------------------------------------------------------------------

   I am runnig postgreSQL 7.0.2 on a RedHat 6.2 linux

                                                 Thanks



Re: Migration

From
John David Garza
Date:
Hello all,

I've got another question for anybdy that's done Postgres -> Oracle
migrations.  Is there a way for oracle's sqlpls to do a read from <stdin>
like psql does with the pg_dump files? Or am i going to have to take this
pg_dump file and replace all the <stdin> lines with INSERT lines?

Or, is there a way for pg_dump to just dump sql only?

John David Garza
garza@keyframe.cjas.org




Re: Migration

From
"Ross J. Reedstrom"
Date:
On Mon, Aug 14, 2000 at 02:08:27PM -0400, John David Garza wrote:
> Hello all,
> 
> I've got another question for anybdy that's done Postgres -> Oracle
> migrations.  Is there a way for oracle's sqlpls to do a read from <stdin>
> like psql does with the pg_dump files? Or am i going to have to take this
> pg_dump file and replace all the <stdin> lines with INSERT lines?
> 
> Or, is there a way for pg_dump to just dump sql only?

Perhaps one of the [dD] options will be of help?

wallace$ pg_dump --help 
pg_dump dumps a database as a text file.

Usage: pg_dump [options] dbname

Options: -a, --data-only          dump out only the data, not the schema -c, --clean              clean (drop) schema
priorto create -C, --create             output commands to create database -d, --inserts            dump data as
INSERT,rather than COPY, commands -D, --attribute-inserts  dump data as INSERT commands with attribute names
 
...

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005


RE: Migration

From
"Darren King"
Date:
> I've got another question for anybdy that's done Postgres -> Oracle
> migrations.  Is there a way for oracle's sqlpls to do a read from <stdin>
> like psql does with the pg_dump files? Or am i going to have to take this
> pg_dump file and replace all the <stdin> lines with INSERT lines?
> 
> Or, is there a way for pg_dump to just dump sql only?

How about coming up with a control file and using SQL*Loader?

Darren


Re: Migration

From
Mike Mascari
Date:
John David Garza wrote:
> 
> Hello all,
> 
> I've got another question for anybdy that's done Postgres -> Oracle
> migrations.  Is there a way for oracle's sqlpls to do a read from <stdin>
> like psql does with the pg_dump files? Or am i going to have to take this
> pg_dump file and replace all the <stdin> lines with INSERT lines?
> 
> Or, is there a way for pg_dump to just dump sql only?

Perhaps pg_dump -d is the solution?

Mike Mascari


Re: Migration

From
Chris Ryan
Date:
It's been a while since i did much with Oracle but last time I did do
something there was a sql loader (don't remember exact name) but you
create the table seperately then create loader files that specify the
format and table and methods to use to load in a flat datafile. This is
probably more work than you were looking for though; having to break up
the dump file into several files.

Chris Ryan
chris@greatbridge.com

John David Garza wrote:
> 
> Hello all,
> 
> I've got another question for anybdy that's done Postgres -> Oracle
> migrations.  Is there a way for oracle's sqlpls to do a read from <stdin>
> like psql does with the pg_dump files? Or am i going to have to take this
> pg_dump file and replace all the <stdin> lines with INSERT lines?
> 
> Or, is there a way for pg_dump to just dump sql only?
> 
> John David Garza
> garza@keyframe.cjas.org