View Issue Details

IDProjectCategoryView StatusLast Update
0004988SymmetricDSBugpublic2021-05-28 20:40
Reporterelong Assigned Toelong  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.12.0 
Target Version3.12.10Fixed in Version3.12.10 
Summary0004988: Batch in conflict won't load when unique key value is null
DescriptionWhen a batch goes into conflict from a PK/UK violation and the UK value for the row is null, the conflict resolver uses the wrong number of arguments to a SQL statement. It passes all arguments, when only non-null arguments should be passed.

2021-05-13 10:12:42,351 WARN [client-1] [JdbcSqlTemplate] [client-1-dataloader-288] Parameter arg 'null' caused exception: Parameter index out of range (2 > number of parameters, which is 1).
2021-05-13 10:12:42,354 ERROR [client-1] [ManageIncomingBatchListener] [client-1-dataloader-288] Failed to load batch server-372 org.jumpmind.db.sql.SqlException: Parameter index out of range (2 > number of parameters, which is 1).
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:313)
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:302)
    at org.jumpmind.db.sql.JdbcSqlTransaction.executeCallback(JdbcSqlTransaction.java:398)
    at org.jumpmind.db.sql.JdbcSqlTransaction.prepareAndExecute(JdbcSqlTransaction.java:364)
    at org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriterConflictResolver.isCaptureTimeNewerForUk(DefaultDatabaseWriterConflictResolver.java:282)
    at org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriterConflictResolver.isCaptureTimeNewer(DefaultDatabaseWriterConflictResolver.java:190)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriterConflictResolver.needsResolved(AbstractDatabaseWriterConflictResolver.java:63)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter.write(AbstractDatabaseWriter.java:216)
    at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.write(NestedDataWriter.java:64)
    at org.jumpmind.symmetric.model.ProcessInfoDataWriter.write(ProcessInfoDataWriter.java:84)
    at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.write(NestedDataWriter.java:64)
    at org.jumpmind.symmetric.io.data.writer.TransformWriter.write(TransformWriter.java:202)
    at org.jumpmind.symmetric.io.data.DataProcessor.forEachDataInTable(DataProcessor.java:212)
    at org.jumpmind.symmetric.io.data.DataProcessor.forEachTableInBatch(DataProcessor.java:178)
    at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:124)
    at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$2.call(DataLoaderService.java:1091)
    at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$2.call(DataLoaderService.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
    at com.mysql.cj.jdbc.ClientPreparedStatement.checkBounds(ClientPreparedStatement.java:1373)
    at com.mysql.cj.jdbc.ClientPreparedStatement.getCoreParameterIndex(ClientPreparedStatement.java:1386)
    at com.mysql.cj.jdbc.ClientPreparedStatement.setNull(ClientPreparedStatement.java:1651)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:499)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:499)
    at org.springframework.jdbc.core.StatementCreatorUtils.setNull(StatementCreatorUtils.java:277)
    at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:228)
    at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:162)
    at org.jumpmind.db.sql.JdbcSqlTemplate.doSetValue(JdbcSqlTemplate.java:1180)
    at org.jumpmind.db.sql.JdbcSqlTemplate.setValues(JdbcSqlTemplate.java:1157)
    at org.jumpmind.db.sql.JdbcSqlTransaction$6.execute(JdbcSqlTransaction.java:371)
    at org.jumpmind.db.sql.JdbcSqlTransaction$6.execute(JdbcSqlTransaction.java:1)
    at org.jumpmind.db.sql.JdbcSqlTransaction.executeCallback(JdbcSqlTransaction.java:396)
    ... 18 more
Steps To ReproduceSync from server to client.

On Server:
create table bugtest (id integer primary key, name varchar(10));
create unique index i_bugtest on bugtest(name);
insert into bugtest values (1,null);

On Client:
create table bugtest (id integer primary key, name varchar(10));
create unique index i_bugtest on bugtest(name);
insert into bugtest values (1,'test');
Tagsconflict manager

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.12 e19172cf

2021-05-13 14:20:24

admin

Details Diff
0004988: Batch in conflict won't load when unique key value is null Affected Issues
0004988
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DefaultDatabaseWriterConflictResolver.java Diff File

SymmetricDS: 3.12 d6452a7f

2021-05-13 14:46:55

admin

Details Diff
0004988: Batch in conflict won't load when unique key value is null Affected Issues
0004988
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DefaultDatabaseWriterConflictResolver.java Diff File

Issue History

Date Modified Username Field Change
2021-05-13 14:17 elong New Issue
2021-05-13 14:17 elong Status new => assigned
2021-05-13 14:17 elong Assigned To => elong
2021-05-13 14:17 elong Tag Attached: conflict manager
2021-05-13 14:17 elong Description Updated View Revisions
2021-05-13 14:47 elong Status assigned => resolved
2021-05-13 14:47 elong Resolution open => fixed
2021-05-13 14:47 elong Fixed in Version => 3.12.10
2021-05-13 15:00 admin Changeset attached => SymmetricDS 3.12 d6452a7f
2021-05-13 15:00 admin Changeset attached => SymmetricDS 3.12 e19172cf
2021-05-28 20:40 admin Status resolved => closed