Subject Java exception when modifying Blob field, what to do?
Author chofman@lucris.nl
Interbase/Firebird community,

In general I am pretty satisfied with the Interbase 6.0/Fireboird
software, but lately
I have run into a problem which gives me a sturn headache.
I am getting an alternating exception when modifying a Blob in a
table row.
The first update is okay, the second will throw the Exception
mentioned below.

java.lang.VerifyError: (class: interbase/interclient/ErrorKey,
method: _$372 signature: (Ljava/lang/String;Ljava/lang/String;I)V)
Expecting to find unitialized object on stack
at interbase.interclient.SQLException.<init>(SQLException.java:96)
at interbase.interclient.RecvMessage.createSQLException
(RecvMessage.java:694)
at interbase.interclient.RecvMessage.makeSQLException
(RecvMessage.java:593)
at interbase.interclient.RecvMessage.get_EXCEPTIONS
(RecvMessage.java:554)
at interbase.interclient.BlobInput.<init>(BlobInput.java:50)
at interbase.interclient.JDBCNet.setBlobString(JDBCNet.java:561)
at interbase.interclient.PreparedStatement.setString
(PreparedStatement.java:987)
at org.opentools.minerva.jdbc.PreparedStatementInPool.setString
(PreparedStatementInPool.java:182)
at org.companion.entity.crm.DocumentBean.ejbStore
(DocumentBean.java:532)
at java.lang.reflect.Method.invoke(Native Method)

more stacktrace....

Now I know this exception is a famous one and points in the direction
of an Interclient
which has to be recompiled under JDK 1.3 So I did that. Still the
same phenomenon.
The definition of the database table is as follows:

create table document
(
DocumentId INTEGER NOT NULL,
OrgId INTEGER,
DivId INTEGER,
DepId INTEGER,
UserId INTEGER NOT NULL,
AccessMask INTEGER,
Creation TIMESTAMP NOT NULL,
CreateUserId INTEGER NOT NULL,
Modification TIMESTAMP,
ModifyUserId INTEGER,
Deletion TIMESTAMP,
DeleteUserId INTEGER,
IssueId INTEGER,
DocCatId INTEGER,
MimeType VARCHAR(64),
Name VARCHAR(64),
FileType VARCHAR(16),
Contents BLOB,
Primary Key(DocumentId)
);
grant SELECT, DELETE, INSERT, UPDATE on table document to
salescompanion;
create index xDocument2 on Document (OrgId);
create index xDocument3 on Document (OrgId, DivId);
create index xDocument4 on Document (OrgId, DivId, DepId);
create index xDocument5 on Document (UserId);

The update I am using is the following:

update Document set
Document.UserId = ?, Document.OrgId = ?, Document.DivId = ?,
Document.DepId = ?,
Document.Modification = ?, Document.ModifyUserId = ?,
Document.Deletion = ?, Document.DeleteUserId = ?,
IssueId = ?, DocCatId = ?, MimeType = ?, Name = ?, FileType
= ?,Contents = ?
where DocumentId = ?

I am utilizing the PreparedStatement. and use setString() to pass a
value for the Blob.

Any hints or solutions to this proble is much appreciated.

Cor Hofman
Lucris b.v.