32142 error when performing additeration, set max iterations set to 2
I'm trying to use the max iterations setting on the statement, I currently have it set to 2. When I perform the additeration method I get the 32142 error on the second addIteration. I tried performing the executeUpdate when the counter was set to max iterations - 1 but then I had two rows inserted in the table instead of 1. I'm using the latest instaclient 11.2.0.3 with Visual Studio 2010, the application is compiled as a x64 application.
stmt->setSQL("INSERT INTO TEST.TEST_TABLE VALUES (:1, :2)");
stmt->setBatchErrorMode(true);
stmt->setMaxIterations(2); // maxIterations
stmt->setMaxParamSize(1, 50);
stmt->setMaxParamSize(2, 9);
loop through file records
try
{
stmt->addIteration();
iterationCount++;
// When set as is app dies with the 32142, when set to maxIterations - 1 then 2 rows are inserted into the table.
if (iterationCount == maxIterations)
{
count = stmt->executeUpdate();
occiConn->commit();
iterationCount = 0;
}
}
catch (const oc::BatchSQLException& sqle)
{
stringstream ss;
ss << "Oracle SQL Exception:" << endl << endl <<
" Error Code = " << sqle.getErrorCode() << endl <<
" Error Message = " << sqle.getMessage() << endl <<
" Details = " << endl << sqle.what();
LOG4CXX_ERROR(pLogger, ss.str());
throw IncrementalExtractException(sqle.getErrorCode(), ss.str());
}
catch (const oc::SQLException& sqle)
{
stringstream ss;
ss << "Oracle SQL Exception:" << endl << endl <<
" Error Code = " << sqle.getErrorCode() << endl <<
" Error Message = " << sqle.getMessage() << endl <<
" Details = " << endl << sqle.what();
LOG4CXX_ERROR(pLogger, ss.str());
}