[Classifier4j-devel] JDBCWordsDataSource.updateWordProbability fails
Status: Beta
Brought to you by:
nicklothian
From: Matt C. <MCo...@my...> - 2003-11-19 00:54:34
|
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 |