Package com.taobao.tddl.common.sync.SyncUtils

Examples of com.taobao.tddl.common.sync.SyncUtils.SQLExceptionInfo


     
      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());
View Full Code Here

TOP

Related Classes of com.taobao.tddl.common.sync.SyncUtils.SQLExceptionInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.