public boolean isDeadlock(SQLException e) {
    return e instanceof SQLTransactionRollbackException
        || ((isMYSQL() || isPOSTGRES() || isSQLSERVER() || isCUSTOM())
            && "40001".equals(e.getSQLState()))
        || (isPOSTGRES() && "40P01".equals(e.getSQLState()))
        || (isORACLE() && (e.getMessage() != null && (e.getMessage().contains("deadlock detected")
            || e.getMessage().contains("can't serialize access for this transaction"))));
  }
Determine the database product type
@param productName string to defer database connection
@return database product type
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java