return System.currentTimeMillis()-beforeInsertSlaveDBTime;
} catch (DataAccessException e) {
if (!throwOnExist && (e instanceof DataIntegrityViolationException)) {
if (e.getCause() instanceof SQLException) {
SQLExceptionInfo expInfo = SyncUtils.getSqlState((SQLException) e.getCause());
if (DBType.MYSQL.equals(slave.getDbType())
&& SyncConstants.ERROR_CODE_DUPLICATE_PRIMARY_KEY_MYSQL == expInfo.getErrorCode()) {
return System.currentTimeMillis()-beforeInsertSlaveDBTime;
} else if(DBType.ORACLE.equals(slave.getDbType())
&& SyncConstants.ERROR_CODE_DUPLICATE_PRIMARY_KEY_ORACLE == expInfo.getErrorCode()) {
return System.currentTimeMillis()-beforeInsertSlaveDBTime;
}
}
}
profile(e, context, timeoutThreshold, System.currentTimeMillis()-beforeInsertSlaveDBTime, slave.getIdentity());