List:NDB Connectors« Previous MessageNext Message »
From:tarbin jiang Date:February 3 2009 3:49am
Subject:RE: what's the reason for problem "Tuple did not exist"?
View as plain text  
Frazer,
thanks for your response.
I did use BLOB type to handle TEXT type column.
pop error code:
         String columnName = "column2";//column2 type is "TEXT"
         String paraValue = "";
         String tableName = "MyTable";
         NdbTransaction trans = ndb.startTransaction();
         NdbOperation op = trans.getInsertOperation(tableName);
         ......
         //get content from a xml file and set to paraValue
         .......
         NdbBlob text;         text = op.getBlobHandle(columnName);        
text.setValue(paraValue.getBytes());
         ....         
         //set other column values
         .....
         ret = trans.execute(ExecType.Commit, AbortOption.AbortOnError,true);
         trans.close();
 
no error code:
         String columnName = "column2";//column2 type is "TEXT"
         String paraValue = "";
         String tableName = "MyTable";
         NdbTransaction trans = ndb.startTransaction();
         NdbOperation op = trans.getInsertOperation(tableName);
         ......
         //set a normal string such as "abcdefg" to paraValue
         .......
         NdbBlob text;         text = op.getBlobHandle(columnName);        
text.setValue(paraValue.getBytes());
         ....         
         //set other column values
         .....
         ret = trans.execute(ExecType.Commit, AbortOption.AbortOnError,true);
         trans.close();
 
Thanks.
tarbin
> Date: Mon, 2 Feb 2009 11:18:24 +0000> From: Frazer.Clement@stripped> Subject:
> Re: what's the reason for problem "Tuple did not exist"?> To: tarbin@stripped> CC:
> ndb-connectors@stripped> > Hi Tarbin,> Can you explain a bit further what
> you are doing?> FYI : TEXT *is* a BLOB with a character set. So you must use the BLOB
> > API to read/write TEXT columns. You *must not* use the normal > setValue/getValue
> API for TEXT columns.> Perhaps you could describe what does and does not work in terms
> of > schemas, your code and the content and length of the data you are using.>
> Frazer> > tarbin jiang wrote:> > all,> > when I insert a record which
> including a TEXT type column, it returns error: > >
> com.mysql.cluster.ndbj.NdbApiPermanentException: Tuple did not exist.> > I found
> that if I set the TEXT type column as a formal string, it works without error.> >
> but if I set the Text type column as a xml file, the error pops.> > The procedure of
> reading xml file is no problem. And I used NDBBlob type to handle text type.> > >
> > insertOperation.setValue(xmlFile.bytes())> > > > can anybody help me?>
> > thanks from tarbin> > > >
> _________________________________________________________________> > News,
> entertainment and everything you care about at Live.com. Get it now!> >
> http://www.live.com/getstarted.aspx> >> > > > -- > Frazer Clement,
> Software Engineer, MySQL Cluster > Sun Microsystems - www.mysql.com> Office:
> Reading, UK> > Are you MySQL certified? www.mysql.com/certification> > > --
> > MySQL NDB Connectors Mailing List> For list archives:
> http://lists.mysql.com/ndb-connectors> To unsubscribe:
> http://lists.mysql.com/ndb-connectors?unsub=1 
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/photos.aspx
Thread
what's the reason for problem "Tuple did not exist"?tarbin jiang2 Feb
  • Re: what's the reason for problem "Tuple did not exist"?Frazer Clement2 Feb
    • RE: what's the reason for problem "Tuple did not exist"?tarbin jiang3 Feb
      • Re: what's the reason for problem "Tuple did not exist"?Frazer Clement3 Feb
        • RE: what's the reason for problem "Tuple did not exist"?tarbin jiang4 Feb
          • Re: what's the reason for problem "Tuple did not exist"?Frazer Clement4 Feb
          • Re: what's the reason for problem "Tuple did not exist"?Frazer Clement1 Mar