Package atg.repository

Examples of atg.repository.RepositoryException


            if (!dbType1.equals(SYBASE2)) {
                allow_keys.add(dbType1);
            }
        }
        if (keys.size() > 0) {
            throw new RepositoryException(
                    "The following keys used in the 'sqlCreateFiles' and/or 'sqlDropFiles' properties "
                            + "are invalid: "
                            + keys
                            + ".  Allowable keys are: "
                            + allow_keys
            );
        }

        boolean isDefaultCreate = (getSqlCreateFiles().get(DEFAULT) != null);
        boolean isDefaultDrop = (getSqlDropFiles().get(DEFAULT) != null);
        // if there are defaults it will always be ok, so just return
        if (isDefaultCreate && isDefaultDrop) {
            return;
        }

        // otherwise, check each dbType individually
        for (String dbType : dbTypes) {
            boolean isCreate = (getSqlCreateFiles().get(dbType) != null);
            boolean isDrop = (getSqlDropFiles().get(dbType) != null);
            if (!isAllowNoDrop()) {
                if (isCreate && !isDrop && !isDefaultDrop) {
                    throw new RepositoryException(
                            "Mapping exists for database type "
                                    + dbType
                                    + " in property 'sqlCreateFiles', but not in property 'sqlDropFiles', and "
                                    + "there is no default specified."
                    );
                }
                if (isDrop && !isCreate && !isDefaultCreate) {
                    throw new RepositoryException(
                            "Mapping exists for database type "
                                    + dbType
                                    + " in property 'sqlDropFiles', but not in property 'sqlCreateFiles', and "
                                    + "there is no default specified."
                    );
View Full Code Here


                Iterator cmds;
                if (isLoggingInfo()) {
                    logInfo("Executing SQL file: " + file);
                }
                if (!new File(file).exists()) {
                    throw new RepositoryException("SQL file " + file + " does not exist.");
                }

                // parse the file to get commands...
                try {
                    Collection c = parser.parseSQLFile(file);
                    if (isLoggingDebug()) {
                        logDebug("Parsed " + c.size() + " SQL command(s) from file.");
                    }
                    cmds = c.iterator();
                } catch (Exception e) {
                    // an error parsing the file indicates something very wrong, so bail
                    throw new RepositoryException(
                            "Error encountered parsing SQL file " + file, e
                    );
                }

                // then execute the commands...
                while (cmds.hasNext()) {
                    cmd = (String) cmds.next();
                    if (cmd.trim().length() == 0) {
                        continue;
                    }
                    if (isLoggingDebug() || isLoggingCreateTables()) {
                        logDebug("Executing SQL cmd [" + cmd + "]");
                    }
                    try {
                        sp.executeSQL(cmd);
                    } catch (Exception e) {
                        if (pStopAtError) {
                            throw new RepositoryException(
                                    "Error received executing command ["
                                            + cmd
                                            + "] from SQL file "
                                            + file, e
                            );
View Full Code Here

TOP

Related Classes of atg.repository.RepositoryException

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.