RE: [Classifier4j-devel] JDBCWordsDataSource.updateWordProbabilit y fails
Status: Beta
Brought to you by:
nicklothian
From: Nick L. <nl...@es...> - 2003-11-19 01:03:07
|
Nice pickup. I guess we should truncate the words to 255 chars at the start of the method. > -----Original Message----- > From: Matt Collier [mailto:MCo...@my...] > Sent: Wednesday, 19 November 2003 11:27 AM > To: Classifier4J > Subject: [Classifier4j-devel] > JDBCWordsDataSource.updateWordProbability > fails > > > JDBCWordsDataSource.updateWordProbability fails if > word.length() > 255. > > The size of word in the database is varchar(255). > > "SELECT 1 FROM word_probability WHERE word = ? AND category = ?") > > Correctly returns no records, because a string containing 255 > "A"s does not > equal a string containing 256 "A"s. > > Since the method proceeds to insert a "new" value, word = 256 > "A"s, which is > of course truncated to 255 characters. A duplicate word > value, key violation > occurs. > > I have temporarily corrected this issue thusly: > > if ( !rs.next()) > > changes to: > > if ( !rs.next() && word.length() <= 255 ) > > Matt Collier > RemoteIT > mco...@my... > 877-4-NEW-LAN > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Classifier4j-devel mailing list > Cla...@li... > https://lists.sourceforge.net/lists/listinfo/classifier4j-devel > |