dbTalk Databases Forums  

[BUGS] BUG #1163: cursor "jdbc_curs_1" does not exist

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1163: cursor "jdbc_curs_1" does not exist in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1163: cursor "jdbc_curs_1" does not exist - 06-14-2004 , 11:34 AM







The following bug has been logged online:

Bug reference: 1163
Logged by: Timo Nentwig

Email address: tmp (AT) nitwit (DOT) de

PostgreSQL version: 7.4

Operating system: Linux

Description: cursor "jdbc_curs_1" does not exist

Details:

Hi!

I read about 4000 html pages (i.e. Strings) from one table, compress them
with GZip and insert them as bytea into another table. Work fine for the
first 100 then this happens:

org.postgresql.util.PSQLException: ERROR: cursor "jdbc_curs_1" does not
exist

at
org.postgresql.util.PSQLException.parseServerError (PSQLException.java:139)
at org.postgresql.core.QueryExecutor.executeV3(QueryE xecutor.java:152)
at org.postgresql.core.QueryExecutor.execute(QueryExe cutor.java:100)
at org.postgresql.core.QueryExecutor.execute(QueryExe cutor.java:67)
org.postgresql.jdbc1.AbstractJdbc1ResultSet.next(A bstractJdbc1ResultSet.jav
at a:157)
at f4t.obsolete.migration.CompressHtml.compress(Compr essHtml.java:40)
at f4t.obsolete.migration.CompressHtml.main(CompressH tml.java:70)



My JDBC driver is 74.213. This is my convertion code:

PreparedStatement insertHtml = f4t.prepareStatement("INSERT INTO
legacy.zhtml (id, zhtml) VALUES (?, ?)");
PreparedStatement selectHtml = f4t.prepareStatement("SELECT urlid, html
FROM html");

f4t.setAutoCommit(false);

selectHtml.setFetchSize(100);

ResultSet row = selectHtml.executeQuery();

for (int j = 1; row.next(); j++)
{
String id = row.getString("urlid");
String html = row.getString("html");

ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
WritableUtils.writeCompressedString(dos, html);

insertHtml.setString(1, id);
insertHtml.setBytes(2, bos.toByteArray());
insertHtml.execute();

System.out.print('.');

if(j%100==0)
{
System.out.println();
f4t.commit();
}
}

f4t.commit();
f4t.setAutoCommit(true);


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.