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.

> 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.
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.



------------------------------------------------------------------------------
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