pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gabriel Lopez <gabilm@dif.um.es>
To: psql <pgsql-interfaces@postgresql.org>
Subject: LargeObjectManager problem
Date: Wed, 04 Oct 2000 14:19:12 +0200
Message-ID: <39DB2040.DA77A982@dif.um.es> (raw)


    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






view thread (2+ messages)  latest in thread

Message-ID: <39DB2040.DA77A982@dif.um.es>
Permalink:  ../39DB2040.DA77A982@dif.um.es/
Also on:    postgresql.org/message-id/39DB2040.DA77A982@dif.um.es

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: gabilm@dif.um.es
  Subject: Re: LargeObjectManager problem
  In-Reply-To: <39DB2040.DA77A982@dif.um.es>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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