'test executing in succession with batch error'

def testUpdatewithBatchError(self):

    self.cursor.execute('truncate    table    TestArrayDML')
    rows = [(1, 'First', 100), (2, 'Second', 200), (3, 'Third', 300), (4, 'Second', 300), (5, 'Fifth', 300), (6, 'Sixth', 400), (6, 'Seventh', 400), (8, 'Eighth', 100)]
    sql = 'insert    into    TestArrayDML    (IntCol,    StringCol,    IntCol2)    values    (:1,    :2,    :3)'
    self.cursor.executemany(sql, rows, batcherrors=True)
    expectedErrors = [(6, 1, 'ORA-00001:    unique    constraint    (CX_ORACLE.TESTARRAYDML_PK)    violated\n')]
    actualErrors = [(e.offset, e.code, e.message) for e in self.cursor.getbatcherrors()]
    self.failUnlessEqual(actualErrors, expectedErrors)
    rows = [(101, 'First'), (201, 'Second'), (3000, 'Third'), (900, 'Ninth'), (301, 'Third')]
    sql = 'update    TestArrayDML    set    IntCol2    =    :1    where    StringCol    =    :2'
    self.cursor.executemany(sql, rows, arraydmlrowcounts=True, batcherrors=True)
    expectedErrors = [(2, 1438, 'ORA-01438:    value    larger    than    specified    precision    allowed    for    this    column\n')]
    actualErrors = [(e.offset, e.code, e.message) for e in self.cursor.getbatcherrors()]
    self.failUnlessEqual(actualErrors, expectedErrors)
    self.failUnlessEqual(self.cursor.getarraydmlrowcounts(), [1, 2, 0, 0, 1])
    self.failUnlessEqual(self.cursor.rowcount, 4)
