Home > Archive > PostgreSQL JDBC > September 2005 > (NONE)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author (NONE)
gurkan@resolution.com

2005-09-01, 8:24 pm

Hi,
I have been working on conversion program from Informix to PostgreSQL db, and I
have a one table which has large data(bytea).

I need to be able to copy this one row (docdata column) that I have which is
close to 32MB. Program seems to read the data but cannot copy to postgres
(PreparedStatement),
it gives OutOfMemoryError. I ran the program with these
heap too.
java -Xms200m -Xmx700m AddDoc
and I do not want to use LargeObject api (I do partion of data based on their
dates going from one table to many tables; data seems to be stored at
pg_largeobjects tbale). Here is the part of the code, and any help apriciated.
How do I copy large data like 32MB or greater?
Thanks

wbin = informixRs.getBinaryStream("docdata");
while ((wbyte = wbin.read ()) != -1) {
wbout.write (wbyte);
}
outln ("Size of KB is: " + wbout.toByteArray().length/1024);
size += wbout.toByteArray().length;
inp = new ByteArrayInputStream
(wbout.toByteArray());
wbin = null;

postgresStmt = postgresConn.prepareStatement("INSERT INTO "+tableName+"
(id,docdata) VALUES (?,?)");
postgresStmt.setInt(1,id);
if(docdef_id.compareTo("12720") == 0 ) {
outln("\n\nbefore out of memory");
postgresStmt.setBinaryStream (2, inp, inp.available());
outln("\n\nafter out of memory");//cannot reach here
} else {
postgresStmt.setBinaryStream (2, inp, inp.available());
}

-------------------------------------------------
This mail sent through IMP: www.resolution.com

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com