// sanity
if (pstmt == null)
return false;
boolean result = false;
try{
for (int i = 0 ; i<requestStart.length; i++) {
RequestStartTO request = (RequestStartTO)requestStart[i];
pstmt.setString(1, request.getRequestId());
pstmt.setLong(2, request.getTimeStamp());
pstmt.setLong (3, request.getTimeStampMillis());
if(request.getRequestType() != null)
pstmt.setString(4, request.getRequestType().toString());
else
pstmt.setString(4, null);
if (request.getIpAddress() != null)
pstmt.setString(5, request.getIpAddress());
else
pstmt.setString (5, null);
pstmt.addBatch();
}
int[] updated = pstmt.executeBatch();
result = (updated.length == requestStart.length)? true : false;
addTotalEntriesProcessed(updated.length);
if (isTraceOn()){
logger.log(Level.INFO, "Callflow: RequestStartAccessObjectImpl " +
" Attempting to Insert : " + requestStart.length +
" Inserted "+updated.length+ " rows."+
" Total Entries written so far: "+
getTotalEntriesProcessed());
}
if (result == false){
logger.log(Level.WARNING, "callflow.error_insert_row");
}
} catch(BatchUpdateException bue) {
// log it
logger.log(Level.FINE, "Error inserting data into CallFlow tables", bue);
result = false;
}catch (SQLException se) {
// log it
logger.log(Level.FINE, "Error inserting data into CallFlow tables", se);
result = false;
}
return result;