List:Cluster« Previous MessageNext Message »
From:Craig L Russell Date:January 19 2012 9:59pm
Subject:Re: Blob and NdbRecord
View as plain text  
Hi George,

On Jan 19, 2012, at 1:41 PM, George Neill wrote:

> Hi Folks,
> I am trying to understand the NDB blob API.  When using
> transaction->readTuple(), the address of the blob pointer is written  
> to the
> ndb record.  After looking at the ndb code, this does NOT appear to  
> happen
> with insertTuple()/updateTuple() calls.  I am just starting to dig  
> in to
> the NDB code base and I am trying to understand why a blob pointer  
> is not
> written/allocated in to the blob stream in these situations.  Or  
> maybe the
> question is better asked as, Why is the blob pointer written only when
> using readTuple() ...   Is there someone on the list who might have
> background on this subject and wouldn't mind explaining it to me!?

The way I understand it, with insertTuple you allocate space in the  
buffer for the blob header pointer before you call insertTuple. After  
that, you can call getBlobHandle on the NdbOperation that is returned,  
you get a brand new blob handle, and you can write to the blob. What  
you are doing is defining one operation with insertTuple and other  
(set of) operations when you operate on the blob handle.

With readTuple, the ndbapi is responsible for giving you the blob  
handle based on the columns you request. In this case, getBlobHandle  
returns the blob handle that was sent by ndbd to the client.


> TIA,
> George

Craig L Russell
Architect, Oracle
408 276-5638 mailto:Craig.Russell@stripped
P.S. A good JDO? O, Gasp!

Blob and NdbRecordGeorge Neill19 Jan
  • Re: Blob and NdbRecordCraig L Russell19 Jan
    • Re: Blob and NdbRecordGeorge Neill19 Jan
      • Re: Blob and NdbRecordCraig L Russell20 Jan