Skip to content

Commit

Permalink
0000982: A conflict is not recorded in sym_incoming_error for sqlite …
Browse files Browse the repository at this point in the history
…because the database is locked and we use a different connection
  • Loading branch information
chenson42 committed Jan 12, 2013
1 parent c6e0db3 commit 881bb9c
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -818,11 +818,14 @@ public void batchInError(DataContext context, Exception ex) {
}

}

ISqlTransaction transaction = context.findTransaction();

// If we were in the process of skipping a batch
// then its status would have been OK. We should not
// set the status to ER.
if (this.currentBatch.getStatus() != Status.OK) {

this.currentBatch.setStatus(IncomingBatch.Status.ER);
if (context.getTable() != null && context.getData() != null) {
try {
Expand All @@ -841,20 +844,22 @@ public void batchInError(DataContext context, Exception ex) {
error.setTargetCatalogName(context.getTable().getCatalog());
error.setTargetSchemaName(context.getTable().getSchema());
error.setTargetTableName(context.getTable().getName());
ISqlTransaction transaction = context.findTransaction();
if (transaction != null) {
insertIncomingError(transaction, error);
} else {
insertIncomingError(error);
}
} catch (UniqueKeyException e) {
// ignore. we already inserted an error for this row
if (transaction != null) {
transaction.rollback();
}
}
}
}
ISqlTransaction transaction = context.findTransaction();

if (transaction != null) {
incomingBatchService.updateIncomingBatch(transaction, this.currentBatch);
incomingBatchService.updateIncomingBatch(transaction, this.currentBatch);
} else {
incomingBatchService.updateIncomingBatch(this.currentBatch);
}
Expand Down

0 comments on commit 881bb9c

Please sign in to comment.