pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedLargeObjectManager problem
2+ messages / 1 participants
[nested] [flat]
* LargeObjectManager problem
@ 2000-10-04 12:19 Gabriel Lopez <gabilm@dif.um.es>
2000-10-04 13:53 ` Re: LargeObjectManager problem Gabriel Lopez <gabilm@dif.um.es>
0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Lopez @ 2000-10-04 12:19 UTC (permalink / raw)
To: 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@dif.um.es
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: LargeObjectManager problem
2000-10-04 12:19 LargeObjectManager problem Gabriel Lopez <gabilm@dif.um.es>
@ 2000-10-04 13:53 ` Gabriel Lopez <gabilm@dif.um.es>
0 siblings, 0 replies; 2+ messages in thread
From: Gabriel Lopez @ 2000-10-04 13:53 UTC (permalink / raw)
To: pgsql-interfaces
Hi again.
the exception raise in the lobj.create() and exacty each 9 times ¿?¡¡
--
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2000-10-04 13:53 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-10-04 12:19 LargeObjectManager problem Gabriel Lopez <gabilm@dif.um.es>
2000-10-04 13:53 ` Gabriel Lopez <gabilm@dif.um.es>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox