On 2-1-2015 17:27, Leyne, Sean wrote:
>
>
>>>> If instead I write 32768 bytes in two writes of 16384 I do receive
>>>> the correct response. Is the client library buffering the blob writes
>>>> somewhere? If so how do I flush?
>>>
>>>      Yes, fbclient have 16K buffer per blob. To flush it you should
>>> close the blob.
>>
>> Thanks. There is really no way to flush and keep the blob open?
>
> Why would you want to flush and keep open?

In this specific case I am testing an OutputStream implementation that 
wraps the blob, when the output stream is flushed (either by an explicit 
call to flush(), or by writing more than the internal buffer), it calls 
the underlying put segment call. In the wire protocol this will write 
immediately to the server.

I validate the behavior of the OutputStream by checking the length of 
the blob reported by Firebird. In some of those test cases I then 
continue writing to the output stream (and the blob) for further checks.

I can probably change the test to not use Firebird at all and mock the 
underlying calls to the server and check for expected method calls on 
this mock; but this adds some more complexity (both to the test and to 
the output stream implementation) and it removes some of the benefits of 
having an end-to-end test of the implementation and Firebird.

> To my mind, either you want to use the blob or not.  Otherwise, all 
> post-flush accesses would require an expensive re-load.
>
> So, if you need it, you keep it.  If not you flush.

The expectations of the OutputStream contract in Java is that if a 
flush() is called explicitly, that the implementation should perform the 
writes to the intended destination (in this case: the server).

Mark
-- 
Mark Rotteveel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to