Subject Re: 335544329 invalid BLOB ID
Author robert_difalco
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
> He means that the error is not caused by the garbage collector. The
> more likely situation is that BLOB is created in one transaction
> (connection), but used in another one - temporary BLOB IDs are valid
> only there.

Would that cause an intermittent failure or would that fail every
time? Looking at our source, it is difficult to see how this could
ever happen. The code looks something like this:

final Blob blob = con.createBlob();
final OutputStream out = blob.setBinaryStream(0);
try
{
out.write( buffer, offset, len );
}
finally
{
out.close();
}

statement.setBlob( pos, blob );
.
.
.
statement.execute();

The statement is then closed in a finally block and the connection is
committed. However, this sequence is happening across multiple
threads. But a single connection/transaction is never shared/used by
more than one thread at a time.

Normally the code is even simpler like:

statement.setBinaryStream( pos, baos, baos.size() );

Which I suppose is just a short-cut for the previous example.

Is there any tracing code I could add to the driver that would add
more context to this exception?

R.