function testUpdate_PrimaryKeyViolation2() {
  var table = env.schema.table('tableA');
  var pkIndexSchema = table.getConstraint().getPrimaryKey();
  var pkIndex = env.indexStore.get(pkIndexSchema.getNormalizedName());

  var row1 = table.createRow({'id': 'pk1', 'name': 'DummyName'});
  var row2 = table.createRow({'id': 'pk2', 'name': 'DummyName'});

  var journal = createJournal([table]);
  journal.insert(table, [row1, row2]);
  assertEquals(2, env.cache.getCount());
  assertTrue(pkIndex.containsKey(row1.payload()['id']));
  assertTrue(pkIndex.containsKey(row2.payload()['id']));

  // Attempting to update row2 to have the same primary key as row1.
  var row2Updated = table.createRow({
    'id': row1.payload()['id'],
    'name': 'OtherDummyName'
  });
  row2Updated.assignRowId(row2.id());
  lf.testing.util.assertThrowsError(
      201,  // Duplicate keys are not allowed.
      journal.update.bind(journal, table, [row2Updated]));
  journal.rollback();
}
Tests the case where a row is updated to have a primary key that already
exists from a row that has been added within the same journal.