Subject | Re: [Firebird-Java] Re: 335544329 invalid BLOB ID |
---|---|
Author | Roman Rokytskyy |
Post date | 2005-12-10T23:23:36Z |
> Would that cause an intermittent failure or would that fail everyShould fail every time.
> time?
> Looking at our source, it is difficult to see how this could ever happen.Looks ok.
> 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.You mean that same sequences are executed by different threads? Or that
parts of this sequence is executed by different threads - e.g. create blob
using one connection/transaction, execute statement in another one?
> Normally the code is even simpler like:Correct - the code above is more or less what drivers does within this
>
> statement.setBinaryStream( pos, baos, baos.size() );
>
> Which I suppose is just a short-cut for the previous example.
method (only that few objects are not created, since the Firebird API is
called directly)
> Is there any tracing code I could add to the driver that would addNot that I know. :) Sure, you can enable the DEBUG level and then go through
> more context to this exception?
each call to check the BLOB IDs, but that will be tons of code. And on the
other hand it won't help you anyway, since the log will contain temp IDs,
and your query will read permanent IDs...
Did you try using LOCAL or EMBEDDED types?
Roman