LargeObjectManager problem

From: Gabriel Lopez <gabilm(at)dif(dot)um(dot)es>
To: psql <pgsql-interfaces(at)postgresql(dot)org>
Subject: LargeObjectManager problem
Date: 2000-10-04 12:19:12
Message-ID: 39DB2040.DA77A982@dif.um.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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");
LargeObject obj = 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(Compiled Code)
at org.postgresql.fastpath.Fastpath.getInteger(Compiled Code)
at org.postgresql.largeobject.LargeObjectManager.create(Compiled Code)
at piscis.pki.ca.database.DBManager.createLOB(Compiled Code)
..............
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(at)dif(dot)um(dot)es

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Gabriel Lopez 2000-10-04 13:53:10 Re: LargeObjectManager problem
Previous Message Adam Haberlach 2000-10-04 03:40:40 Re: C++ client libs