Subject Re: null blob causes exception
Author issujh
Hi,

We are having the same problem, and my Boss, Simon Harper, wrote
about an "Obscure Error" a while back:

http://groups.yahoo.com/group/Firebird-Java/message/3124

Since the, we have not really solved the problem but have suspicions
about a Firebird Administration application call IB Manager (or
Quickdesk - The previous version) from EMS:

http://www.ems-hitech.com/ibmanager

Do you happen to use this program?

This is reproducable by following these steps:

1) Within IB Manager, tick the NULL tick-box within a BLOB field.
2) Press Commit, and the tick-box will then be unticked but the field
will be empty.
3) Select the field using FirebirdSQL, and you will get the following
error:

java.sql.SQLException: You can't read a new blob
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>
(FBBlob.java:343)
at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>
(FBBlob.java:338)
at org.firebirdsql.jdbc.FBBlob.getBinaryStream
(FBBlob.java:158)
at org.firebirdsql.jdbc.FBLongVarCharField.getBytes
(FBLongVarCharField.java:107)
at org.firebirdsql.jdbc.FBLongVarCharField.getCachedObject
(FBLongVarCharField.java:149)
at org.firebirdsql.jdbc.FBCachedFetcher.<init>
(FBCachedFetcher.java:119)
at org.firebirdsql.jdbc.FBResultSet.<init>
(FBResultSet.java:122)
at org.firebirdsql.jdbc.FBStatement.getCachedResultSet
(FBStatement.java:565)
at org.firebirdsql.jdbc.FBStatement.executeQuery
(FBStatement.java:107)
at TestDB.main(TestDB.java:17)

4) Tick the tick-box again and commit.
5) The query executes without an error.

Does this sound familiar?

Jonathan Handford

--- In Firebird-Java@yahoogroups.com, "adobni"
<Alejandro.Dobniewski@s...> wrote:
> Trying to execute a query causes the following exception if a record
> has a null blob field. Seems like a bug, could it be corrected?
>
> java.sql.SQLException: You can't read a new blob
> at
> org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>
(FBBlob.java:343)
> at
> org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>
(FBBlob.java:338)
> at org.firebirdsql.jdbc.FBBlob.getBinarySt
> ream(FBBlob.java:158)
> at
> org.firebirdsql.jdbc.FBBlobField.getBytesInternal
(FBBlobField.java:12
> 5)
> at
> org.firebirdsql.jdbc.FBBlobField.getCachedObject
(FBBlobField.java:172
> )
> at
> org.firebirdsql.jdbc.FBCachedFetcher.<init>
(FBCachedFetcher.java:119)
> at org.firebirdsql.jdbc.FBResultSet.<init>
> (FBResultSet.java:122)
> at
> org.firebirdsql.jdbc.FBStatement.getCachedResultSet
(FBStatement.java:
> 565)
> at
> org.firebirdsql.jdbc.FBStatement.executeQuery(FBStatement.java:107)
> at
> com.sibs.sf2.server.controller.comandos.CmdUltimoRelease.execute
(CmdU
> ltimoRelease.java:34)
> at webService.SF2ServerImpl.login(Unknown Source)