Currently implemented in batches (https://github.com/FirebirdSQL/firebird/tree/batch) BLOBs have hard-coded BPB which makes all BLOBs have stream type. Certainly this is not what we want in release version. I suggest the following:

- current hard-coded BPB remains as default for all BLOBs created by Batch when other BPB is not set - i.e. with Batch default type of blob becomes stream one, not segmented;

- function is added to the Batch interface making it possible to preset any other user-defined BPB for blobs that will not have it set explicitly;

- 2 parameters are added to addBlob() function containg (as always) length of BPB and it's data, '0, NULL' means use of default BPB;

- BLOB header in addBlobStream() is extended with additional parameter, BPB length, with BPB data stored right after the header and followed by BLOB data.


Next we need a way to pass data of segmented BLOB to the Batch. When using blob stream mode it's quite clear - each segment in the stream is prefixed by 16-bit length of segment aligned on 2-byte boundary. Length is provided in host (not network) order, i.e. remote layer should provide xdr-level conversion. When using addBlob() and appendBlobData() looks like the only clear for users way to go is to make addBlob() store first segment with next segments stored by appendBlobData(). That's not top efficient in case of small segments but luckily BLOBs have buffering in both engine and network providers. i.e. performance should not fall seriously.


Comments?




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to