Subject | Re: 335544329 invalid BLOB ID |
---|---|
Author | robert_difalco |
Post date | 2005-12-10T19:10:10Z |
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
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.
> He means that the error is not caused by the garbage collector. TheWould that cause an intermittent failure or would that fail every
> more likely situation is that BLOB is created in one transaction
> (connection), but used in another one - temporary BLOB IDs are valid
> only there.
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.