Details
Description
The problem is in the function with prototype
public boolean set(int sequence, String message)
The mistaken code says:
update.setInt(offset++, sequence);
update.setString(offset, message);
But ought to be:
update.setString(offset++, message);
update.setInt(offset, sequence);
instead.
If we see the place where INSERT_UPDATE_MESSAGE is defined
INSERT_UPDATE_MESSAGE = "UPDATE " + messageTableName + " SET message=? " + "WHERE "
+ idWhereClause + " and msgseqnum=?";
it is clear that the message ought to be stored before the sequence number.