LargeObjectManager problem
От | Gabriel Lopez |
---|---|
Тема | LargeObjectManager problem |
Дата | |
Msg-id | 39DB2040.DA77A982@dif.um.es обсуждение исходный текст |
Список | pgsql-interfaces |
Hi all. I'm working with LargeObjectManager to create LOB object as the documentation examples. I have postgresql 7.0.2 with jdk1.2 and jsdk20 I have the following method to create LOB objects: *********************************************************************** private int createLOB(ByteArrayInputStream bais) throws FileNotFoundException, IOException, SQLException { System.err.println("Creating a large object"); int oid = lobj.create(LargeObjectManager.READ|LargeObjectManager.WRITE); System.err.println("Open a large object"); LargeObjectobj = lobj.open(oid,LargeObjectManager.WRITE); System.err.println("Copying file to large object"); byte buf[] = new byte[2048]; int s,tl=0; while((s=bais.read(buf,0,2048))>0){ System.out.println("Block size="+s+" offset="+tl); obj.write(buf,0,s); tl+=s; } System.err.println("Closing object"); obj.close(); return oid; } ************************************************************************** when I insert the LOB object in a table: ByteArrayInputStream bais = new ByteArrayInputStream(x); int oid = createLOB(bais); String query = "insert into tupdate values ('"+ pkey_value +"','" + CN + "','" + client + "','" +requestFormat + "','" +date + "','" + oid + "','" + updated +"')"; s.executeUpdate(query); connection.commit(); bais.close(); It work fine, but sometime (only sometime) fail with: FastPath call returned FATAL 1: my bits moved right off the end of the world! Recreate index pg_attribute_relid_attnam_index. at org.postgresql.fastpath.Fastpath.fastpath(Compiled Code) at org.postgresql.fastpath.Fastpath.fastpath(CompiledCode) at org.postgresql.fastpath.Fastpath.getInteger(Compiled Code) at org.postgresql.largeobject.LargeObjectManager.create(Compiled Code) at piscis.pki.ca.database.DBManager.createLOB(CompiledCode) .............. CArevoke Error: FastPath call returned FATAL 1: my bits moved right off the end of the world! Recreate index pg_attribute_relid_attnam_index. Why? Can anybody help me, please -- Gabriel López Millán Facultad de Informática -Universidad de Murcia 30001 Murcia - España (Spain) Telf: +34-968-364644 E-mail: gabilm@dif.um.es
В списке pgsql-interfaces по дате отправления: