Subject Problem with Win2000, Firebir 1.5 and driver 1.5.4 with Blob...
Author phil_hhn
We have some code which works without any issues on WinXP and the Mac,
but when running the identical application on Win2000 we get an error.
The application & database are typically on the same machine, hence I
run this on XP or the Mac with no problems. Both of these can use the
database on Win2000 with no problem. But running the client code on
Win2000, it doesn't matter whether the code points to a local database
or one on the Mac or XP, the error occurs, so it definitely appears to
be a client-side issue, presumeably within Java or the JDBC driver.

When the application exits and closes the JDBC connection, the
following error occurs:
org.firebirdsql.jdbc.FBSQLException: I/O Exception. couldn't close
blob: org.firebirdsql.gds.GDSException: invalid BLOB handle
at
org.firebirdsql.jdbc.field.FBBlobField.close(FBBlobField.java:63)
at org.firebirdsql.jdbc.FBResultSet.close(FBResultSet.java:251)
at
org.firebirdsql.jdbc.AbstractStatement.close(AbstractStatement.java:235)
at
org.firebirdsql.jdbc.AbstractConnection.freeStatements(AbstractConnection.java:107)
at
org.firebirdsql.jdbc.AbstractConnection.close(AbstractConnection.java:423)

This is rather strange because we can run some code when we're not
even touching records that contain blobs. We haven't selected any
records containing blobs.

Our database structure consists of a blobs table (Blobs) and another
table (VisualSearch) with a fk to it.
The fk to Blobs in table VisualSearch can be null. Whether it is or
isn't, if we update a VisualSearch record, the exception occurs when
we exit. If we don't update a record, no exception occurs. Here is the
structure:

/* ============================================================ */
create table BLOBS
(
BLOB_SN INTEGER not null,
DESCRIPTION VARCHAR(80) ,
DATA BLOB ,
USED_DATASIZE INTEGER ,
constraint PK_BLOBS primary key (BLOB_SN)
);

create table VISUALSEARCH
(
VISUALSEARCH_SN INTEGER not null,
BLOB_SN INTEGER ,
BUTTONNUMBER INTEGER ,
PARENT_VISUALSEARCH_SN INTEGER ,
SEARCHCATEGORY CHAR(20) ,
constraint PK_VISUALSEARCH primary key (VISUALSEARCH_SN)
);

alter table VISUALSEARCH
add constraint FK_VISUALSE_REF_6678_VISUALSE foreign key
(PARENT_VISUALSEARCH_SN)
references VISUALSEARCH;

alter table VISUALSEARCH
add constraint FK_VISUALSE_REF_6682_BLOBS foreign key (BLOB_SN)
references BLOBS;
/* ============================================================ */

For example if we run "update VisualSearch set ButtonNumber = 5 where
VisualSearch_Sn = 1", the error will occur, even if fk Blob_Sn is null.

Any ideas?
Thanks...