On Mon, 09 Dec 2013 12:50:50 +0400, Alex Peshkoff <[email protected]>
wrote:
> On 12/08/13 17:57, Mark Rotteveel wrote:
>> What is the meaning of the blob_id in the response to op_open_blob(2)?
> 
> Number of that object at the server site.

That is the object handle, which is a different entity from the blob id in
the response message.

>> It is not the same as the original blob_id.
> 
> Definitely not.
> 
>> Is it something that can
>> (should?) be ignored?
> 
> If we want to work with that blob later ignoring returned by server ID 
> is very bad idea :-)
> 
>>
>> The current implementation in Jaybird uses it to replace the current
>> blob id in the handle, but that doesn't seem very logical to me.
> 
> I do not know details of Jaybird. It's strange for me that blob handle 
> exists before getting successful reply from server to open blob, but 
> different implementations may exist.

I am not talking about the object handle, but about the blob id.

> ID returned by the server is a number of a blob object in the server's 
> communication port (exactly like each transaction, statement, etc. has 
> it's ID) and should be used later to ask server to perform some 
> operation with that blob (like get segment). I.e. it should be stored 
> somewhere in blob's handle. Where and how - definitely implementation's 
> defined. This is how it's done in fbclient (I've thrown away some parts 
> of code to make it better readable):
> 
>          PACKET* packet = &rdb->rdb_packet;
>          packet->p_operation = op_open_blob2;
>          P_BLOB* p_blob = &packet->p_blob;
>          p_blob->p_blob_transaction = transaction->rtr_id;
>          p_blob->p_blob_id = *id;        // blob id passed by user
> 
>          send_and_receive(status, rdb, packet);
> 
>          Rbl* blob = new Rbl;
>          blob->rbl_rdb = rdb;
>          blob->rbl_rtr = transaction;
>          blob->rbl_id = packet->p_resp.p_resp_object;    // ID returned 
> by server
> 
> I.e. initial blob id from user never goes into handle at all.

So if I understand correctly in open_blob the blob id is not returned;
isn't that inconsistent as it is returned for create_blob?

Mark


------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to