Hi Tarbin,
Thanks for sending more details.
I looked at the NDB/Bindings implementation of Blob handling yesterday
and believe it has some bugs which may mean that :
1) Blob/Text data written in via NDB/Bindings may not be correctly
copied from the supplied buffer
2) Blob/Text data read back via NDB/Bindings may not be correctly
copied to the user's supplied buffer.
This needs to be fixed in the NDB/Bindings code before you can
succesfully use BLOB and TEXT column types.
I'm afraid that I don't know right now when that will happen.
Frazer
tarbin jiang wrote:
> 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
> >
>
>
> ------------------------------------------------------------------------
> What can you do with the new Windows Live? Find out
> <http://www.microsoft.com/windows/windowslive/default.aspx>
--
Frazer Clement, Software Engineer, MySQL Cluster
Sun Microsystems - www.mysql.com
Office: Reading, UK
Are you MySQL certified? www.mysql.com/certification