On 20/08/2021 16:18, Alex Peshkoff via Firebird-devel wrote:
On 8/20/21 4:01 PM, Tony Whyman wrote:
You can specify such limit - use IBatch::TAG_BUFFER_BYTES_SIZE
parameter in batch parameters block when creating a batch, default is
16Mb, hard limit - 256Mb. Ywo such buffers will be available - one for
messages data, other - for blobs.
Well, in theory OOM can take place later, but that is abnormal case.
Alternatively, I could also work with an IBatch method that told me the
minimum number of guaranteed calls to IBatch::add (for a given message
buffer size). Other suggestions are welcome.
Divide what you've requested in TAG_BUFFER_BYTES_SIZE by
getAlignedLength() of your message. But be aware that this will not
work when/if we move to variable message size and string field with
unrestricted length.
And this is where the problem lies. We need a long term strategy.
One possible strategy would be to choose a number (e.g. 100), multiply
it by getAlignedLength() and then set TAG_BUFFER_BYTES_SIZE to either
the assumed default (16MB) or a larger value if 100* getAlignedLength()
> 16MB.
The problem is that, as you note, this will fail "when/if we move to
variable message size". Perhaps a getMaxAlignedLength() is needed, or a
TAG to force fixed alignment?
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel