Re: NPE in BlobInputStream

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: NPE in BlobInputStream
Дата
Msg-id Pine.BSO.4.64.0611260628100.2107@leary2.csoft.net
обсуждение исходный текст
Ответ на NPE in BlobInputStream  (matrixx <matrixx@freenet.de>)
Ответы Re: NPE in BlobInputStream  (matrixx <matrixx@freenet.de>)
Re: NPE in BlobInputStream  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc

On Fri, 24 Nov 2006, matrixx wrote:

> im using the postgresql-8.1-407.jdbc3.jar driver over hibernate 3 to access
> databases.
>
> Our application currently runs with mysql and mssql drivers without any
> problems. With the postgresql driver i get the following exception:
>
> [ModuleProfile.deserialize@AWT-EventQueue-0] ERROR: Error deserializing blob.
> java.lang.NullPointerException
>     at
> org.postgresql.largeobject.BlobInputStream.close(BlobInputStream.java:115)
>     at java.beans.XMLDecoder.close(XMLDecoder.java:152)
>     ...
>
> I dont know if its a driver bug, or a hibernate issue.
>

It's a driver bug that's caused by one of two possible issues.  It's
impossible to tell which from this stacktrace alone.

1) The BlobInputStream is violating the contract of the close method that
allows you to call it more than once.

2) You've called getInputStream more than once on a Blob and it can't
handle two streams simultaneously.

I've produced a fix for 1 and a very simple version of 2.  Could you try
out this jar file and let me know if it works:

http://www.ejurka.com/pgsql/jars/mx/

Kris Jurka

Вложения

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: binary tuple receiving patch v4
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: JDBC driver and stored proc dollars quoting bugged in