Package com.mysql.clusterj

Examples of com.mysql.clusterj.ClusterJUserException


     * Throw a user exception if there is an active transaction.
     * @param methodName the name of the method
     */
    private void assertNotActive(String methodName) {
        if (transactionState.isActive()) {
            throw new ClusterJUserException(
                    local.message("ERR_Transaction_Must_Not_Be_Active_For_Method",
                    methodName));
        }
    }
View Full Code Here


    public void setPartitionKey(Class<?> domainClass, Object key) {
        DomainTypeHandler<?> domainTypeHandler = getDomainTypeHandler(domainClass);
        String tableName = domainTypeHandler.getTableName();
        // if transaction is enlisted, throw a user exception
        if (isEnlisted()) {
            throw new ClusterJUserException(
                    local.message("ERR_Set_Partition_Key_After_Enlistment", tableName));
        }
        // if a partition key has already been set, throw a user exception
        if (this.partitionKey != null) {
            throw new ClusterJUserException(
                    local.message("ERR_Set_Partition_Key_Twice", tableName));
        }
        ValueHandler handler = domainTypeHandler.createKeyValueHandler(key);
        this.partitionKey= domainTypeHandler.createPartitionKey(handler);
        // if a transaction has already begun, tell the cluster transaction about the key
View Full Code Here

        if (value == null) {
            if (ScanFilter.BinaryCondition.COND_EQ.equals(condition)) {
                filter.isNull(storeColumn);
                return;
            } else {
                throw new ClusterJUserException(
                        local.message("ERR_Null_Values_Can_Only_Be_Filtered_Equal",
                                domainTypeHandler.getName(), name, condition));
            }
        }
        try {
View Full Code Here

    public void partitionKeySetPart(PartitionKey result, ValueHandler handler) {
        try {
            objectOperationHandlerDelegate.partitionKeySetPart(this, result, handler);
        } catch (NullPointerException npe) {
            throw new ClusterJUserException(
                    local.message("ERR_Key_Must_Not_Be_Null",
                            domainTypeHandler.getName(), getName()));
        }
    }
View Full Code Here

    protected static java.util.Date parse(String dateString) {
        try {
            return new SimpleDateFormat().parse(dateString);
        } catch (ParseException ex) {
            throw new ClusterJUserException(local.message("ERR_Parse_Exception", dateString));
        }
    }
View Full Code Here

        return buffer.toString();
    }

    protected void reportErrors() {
        if (errorMessages != null) {
            throw new ClusterJUserException(errorMessages.toString());
        }
    }
View Full Code Here

                    // flush new flushed deleted instance
                    session.delete(domainTypeHandler, valueHandler);
                } else if (pcState == PCState.PNEWFLUSHEDDELETEDFLUSHED) {
                    // nothing to do
                } else {
                    throw new ClusterJUserException(
                            local.message("ERR_Unsupported_Flush_Operation",
                            pcState.toString()));
                }
            } catch (Exception ex) {
                if (logger.isDebugEnabled()) {
View Full Code Here

            }
        }
        // make sure all columns are fields and if not, throw an exception
        for (String columnName: columnNames) {
            if (columnNameToFieldNumberMap.get(columnName) == null) {
                throw new ClusterJUserException(
                        local.message("ERR_Column_Name_Not_In_Table", columnName,
                        Arrays.toString(fieldNames),
                        domainTypeHandler.getTableName()));
            }
        }
View Full Code Here

        try {
            int parameterIndex = Integer.valueOf(index) + offset;
            Byte result = parameterBindings.getByte(parameterIndex);
            return result;
        } catch (SQLException ex) {
                throw new ClusterJUserException(local.message("ERR_Getting_Parameter_Value", offset, index), ex);
        }
    }
View Full Code Here

        try {
            int parameterIndex = Integer.valueOf(index) + offset;
            BigDecimal result = parameterBindings.getBigDecimal(parameterIndex);
            return result;
        } catch (SQLException ex) {
                throw new ClusterJUserException(local.message("ERR_Getting_Parameter_Value", offset, index), ex);
        }
    }
View Full Code Here

TOP

Related Classes of com.mysql.clusterj.ClusterJUserException

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.