Skip to content

Commit

Permalink
0002173: "arithmetic exception, numeric overflow, or string truncatio…
Browse files Browse the repository at this point in the history
…n" on firebird due to row_data being > 10k. Log a better error msg.
  • Loading branch information
chenson42 committed Feb 3, 2015
1 parent 187cca9 commit c1f1489
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -20,6 +20,8 @@
*/
package org.jumpmind.symmetric.route;

import static org.apache.commons.lang.StringUtils.isNotBlank;

import java.sql.SQLException;
import java.sql.Types;
import java.util.ArrayList;
Expand All @@ -31,6 +33,7 @@
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;

import org.jumpmind.db.platform.firebird.FirebirdDatabasePlatform;
import org.jumpmind.db.sql.ISqlReadCursor;
import org.jumpmind.db.sql.ISqlRowMapper;
import org.jumpmind.db.sql.ISqlTemplate;
Expand Down Expand Up @@ -198,7 +201,16 @@ protected void execute() {
processInfo.setStatus(Status.OK);
} catch (Throwable ex) {
processInfo.setStatus(Status.ERROR);
log.error("", ex);
String msg = "";
if (engine.getDatabasePlatform() instanceof FirebirdDatabasePlatform
&& isNotBlank(ex.getMessage())
&& ex.getMessage().contains(
"arithmetic exception, numeric overflow, or string truncation")) {
msg = "There is a good chance that the truncation error you are receiving is because contains_big_lobs on the '"
+ context.getChannel().getChannelId()
+ "' channel needs to be turned on. Firebird casts to varchar when this setting is not turned on and the data length has most likely exceeded the 10k row size";
}
log.error(msg, ex);
} finally {
if (cursor != null) {
cursor.close();
Expand Down

0 comments on commit c1f1489

Please sign in to comment.