Another LargeObject problem - Mailing list pgsql-jdbc

From Ole Streicher
Subject Another LargeObject problem
Date
Msg-id qfoezix2yg.fsf@ebp00439.ebp.de
Whole thread Raw
Responses Re: Another LargeObject problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
Hi,

I have another Problem when using LargeObjects.
From time to time, I get the exception

FastPath call returned ERROR:  lo_lseek: invalid large obj descriptor (369)

What does this exception mean? It occurs randomly; a repeated
retrieval works usually.

The code I use here is appended below.

BTW, yesterday I posted another question, but that has not arrived at
the mailing list (even the retry after I subscribed). Is there any
problem with the list or does it just take some days to appear there?

Ciao

Ole

-----------------------------8<------------------------------------------
PreparedStatement queryStmt
  = dbConn.prepareStatement("SELECT Values, From_Date, To_Date FROM "
                            + tableName
                            +" WHERE From_Date <= ? AND To_Date > ?");

queryStmt.setTimestamp(1, from);
queryStmt.setTimestamp(2, to);
ResultSet rs = queryStmt.executeQuery();
while (rs.next()) {
  Timestamp f = rs.getTimestamp(2);
  Timestamp t = rs.getTimestamp(3);
  int oid = rs.getInt(1);
  LargeObject obj = lobj.open(oid, LargeObjectManager.READ);

  byte[] b = new byte[obj.size()]; //  *** Here it happens ****
  obj.read(b, 0, b.length);
  // ...
}

pgsql-jdbc by date:

Previous
From: Paul Thomas
Date:
Subject: Re: quick question about PreparedStatements
Next
From: Ole Streicher
Date:
Subject: Problem with LargeObject/jdbc when writing short (Repost)