// sanity
if (pstmt == null)
return false;
boolean result = false;
try{
for (int i = 0 ; i<transferObject.length; i++) {
MethodStartTO methodStartTO = (MethodStartTO)transferObject[i];
pstmt.setString(1, methodStartTO.getRequestId());
pstmt.setLong(2, methodStartTO.getTimeStamp());
if (methodStartTO.getComponentType() != null)
pstmt.setString(3, methodStartTO.getComponentType().toString());
else
pstmt.setString(3, null);
pstmt.setString(4, methodStartTO.getComponentName());
pstmt.setString(5, methodStartTO.getAppName());
pstmt.setString(6, methodStartTO.getMethodName());
pstmt.setString(7, methodStartTO.getModuleName());
pstmt.setString(8, methodStartTO.getThreadId());
pstmt.setString(9, methodStartTO.getTransactionId());
pstmt.setString(10, methodStartTO.getSecurityId());
pstmt.addBatch();
}
int[] updated = pstmt.executeBatch();
result = (updated.length == transferObject.length)? true : false;
addTotalEntriesProcessed(updated.length);
if (isTraceOn()){
logger.log(Level.INFO, "Callflow: MethodStartAccessObjectImpl " +
" Attempting to Insert : " + transferObject.length +
" Inserted "+updated.length+ " rows." +
" Total Entries written so far : "+ getTotalEntriesProcessed());
}
} 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;