Re: FastPath call returned ERROR

From: Barry Lind <barry(at)xythos(dot)com>
To: acshafer(at)moon(dot)hec(dot)utah(dot)edu
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: FastPath call returned ERROR
Date: 2001-10-19 01:07:30
Message-ID: 3BCF7CD2.5080509@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Andrew,

I think I see the problem. (It was the 'invalid large obj descriptor
(0)' message that clued me in). The LargeObject reference is only valid
within a transaction. Thus if you have autocommit turned on, you
basically can't use LargeObjects. Because as soon as the sql is
executed to get the large object reference, it is autocommitted and then
this reference can't be used anymore since the transaction ended. Try
turning autocommit off and you should have more luck.

thanks,
--Barry

acshafer(at)moon(dot)hec(dot)utah(dot)edu wrote:

>
> Still trying to store and retrieve large objects, still having trouble.
>
> Though I'd rather be able to set/get streams from the
> PreparedStatment/ResultSet, I thought I'd try to use the postgres
> extensions and see where I get with that.
>
> Here is what I tried so far.
>
> LargeObjectManager loman =
> ((org.postgresql.Connection)con).getLargeObjectAPI();
>
> int looid = loman.create();
>
> LargeObject lo = loman.open(looid);
>
> Everything seems to work as expected until I try to write a byte[] with
>
> lo.write(b); //b is some arbitrary byte array
>
> The result is:
>
> FastPath call returned ERROR: lo_write: invalid large obj descriptor (0)
>
> Any comments or ideas?
>
> Andrew
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Momjian 2001-10-19 01:14:48 Re: [PATCHES] Ant configuration
Previous Message Dave Cramer 2001-10-18 23:47:17 Re: [PATCHES] Ant configuration