View Issue Details

IDProjectCategoryView StatusLast Update
0001723SymmetricDSImprovementpublic2014-06-16 20:27
Reporterboris_pavlovicAssigned Tochenson 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.5.21 
Target Version3.6.0Fixed in Version3.6.0 
Summary0001723: Unique constraint violation is not logged for tables declared for conflict detection
DescriptionFrom the source code: https://svn.code.sf.net/p/symmetricds/code/tags/symmetric-build-3.5.21/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DatabaseWriter.java

Method: LoadStatus insert(CsvData)

Part:

} catch (SqlException ex) {
  if (platform.getSqlTemplate().isUniqueKeyViolation(ex)) {
    if (!platform.getDatabaseInfo().isRequiresSavePointsInTransaction()) {
      context.put(CUR_DATA,getCurData(transaction));
      return LoadStatus.CONFLICT;
    } else {
      log.warn("Detected a conflict via an exception, but cannot perform conflict resolution because the database in use requires savepoints");
      throw ex;
    }
  } else {
    throw ex;
  }
}

So if the INSERT statement is violating an unique constraint and the table is declared for conflict detection this block of code will miss logging the cause of the conflict.
Steps To Reproducehave a table defining a unique constraint on one of its columns
manually insert a row with an id 1, and value 1 in the column that has a unique constraint
declare the table for conflict detection
have another node push a row with an id 2, and value 1 in the column that has a unique constraint
TagsNo tags attached.

Activities

chenson

2014-05-22 09:50

administrator   ~0000523

Good suggestion.

Related Changesets

SymmetricDS: master ba33fa2e

2014-05-22 09:51:17

chenson

Details Diff
0001723: Unique constraint violation is not logged for tables declared for conflict detection
0001723
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/AbstractDatabaseWriter.java Diff File
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/AbstractDatabaseWriterConflictResolver.java Diff File
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/ConflictException.java Diff File
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DefaultDatabaseWriter.java Diff File

SymmetricDS: master 896614ec

2014-06-05 20:49:02

chenson

Details Diff
0001723: Unique constraint violation is not logged for tables declared for conflict detection
0001723
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataLoaderService.java Diff File

Issue History

Date Modified Username Field Change
2014-05-20 04:22 boris_pavlovic New Issue
2014-05-22 09:50 chenson Note Added: 0000523
2014-05-22 09:50 chenson Fixed in Version => 3.6.0
2014-05-22 09:50 chenson Target Version => 3.6.0
2014-05-22 09:51 chenson Status new => resolved
2014-05-22 09:51 chenson Resolution open => fixed
2014-05-22 09:51 chenson Assigned To => chenson
2014-05-22 10:00 Changeset attached => SymmetricDS trunk r8290
2014-06-05 21:00 Changeset attached => SymmetricDS trunk r8355
2014-06-16 20:27 chenson Status resolved => closed
2015-07-30 21:49 chenson Changeset attached => SymmetricDS master 896614ec
2015-07-30 21:49 chenson Changeset attached => SymmetricDS master ba33fa2e