当前位置: 首页>>代码示例>>Java>>正文


Java Database.CLOSEMODE_NORMAL属性代码示例

本文整理汇总了Java中org.hsqldb.Database.CLOSEMODE_NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Java Database.CLOSEMODE_NORMAL属性的具体用法?Java Database.CLOSEMODE_NORMAL怎么用?Java Database.CLOSEMODE_NORMAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.hsqldb.Database的用法示例。


在下文中一共展示了Database.CLOSEMODE_NORMAL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: closeLog

/**
 *  Shuts down the logging process using the specified mode. <p>
 *
 * @param  closemode The mode in which to shut down the logging
 *      process
 *      <OL>
 *        <LI> closemode -1 performs SHUTDOWN IMMEDIATELY, equivalent
 *        to  a poweroff or crash.
 *        <LI> closemode 0 performs a normal SHUTDOWN that
 *        checkpoints the database normally.
 *        <LI> closemode 1 performs a shutdown compact that scripts
 *        out the contents of any CACHED tables to the log then
 *        deletes the existing *.data file that contains the data
 *        for all CACHED table before the normal checkpoint process
 *        which in turn creates a new, compact *.data file.
 *        <LI> closemode 2 performs a SHUTDOWN SCRIPT.
 *      </OL>
 *
 * @return  true if closed with no problems or false if a problem was
 *        encountered.
 */
public boolean closeLog(int closemode) {

    if (log == null) {
        return true;
    }

    try {
        switch (closemode) {

            case Database.CLOSEMODE_IMMEDIATELY :
                log.shutdown();
                break;

            case Database.CLOSEMODE_NORMAL :
                log.close(false);
                break;

            case Database.CLOSEMODE_COMPACT :
            case Database.CLOSEMODE_SCRIPT :
                log.close(true);
                break;
        }
    } catch (Throwable e) {
        appLog.logContext(e, "error closing log");
        appLog.close();

        log = null;

        return false;
    }

    appLog.sendLine(SimpleLog.LOG_ERROR, "Database closed");
    appLog.close();

    log = null;

    return true;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:59,代码来源:Logger.java

示例2: close

/**
 *  Shuts down the logging process using the specified mode. <p>
 *
 * @param  closemode The mode in which to shut down the logging
 *      process
 *      <OL>
 *        <LI> CLOSEMODE_IMMEDIATELY performs SHUTDOWN IMMEDIATELY, equivalent
 *        to  a poweroff or crash.
 *        <LI> CLOSEMODE_NORMAL performs a normal SHUTDOWN that
 *        checkpoints the database normally.
 *        <LI> CLOSEMODE_COMPACT performs a shutdown compact that scripts
 *        out the contents of any CACHED tables to the log then
 *        deletes the existing *.data file that contains the data
 *        for all CACHED table before the normal checkpoint process
 *        which in turn creates a new, compact *.data file.
 *        <LI> CLOSEMODE_SCRIPT performs a SHUTDOWN SCRIPT.
 *      </OL>
 *
 * @return  true if closed with no problems or false if a problem was
 *        encountered.
 */
public boolean close(int closemode) {

    boolean result = true;

    if (log == null) {
        textTableManager.closeAllTextCaches(false);

        return true;
    }

    log.synchLog();
    database.lobManager.synch();

    try {
        switch (closemode) {

            case Database.CLOSEMODE_IMMEDIATELY :
                log.shutdown();
                break;

            case Database.CLOSEMODE_NORMAL :
                log.close(false);
                break;

            case Database.CLOSEMODE_COMPACT :
            case Database.CLOSEMODE_SCRIPT :
                log.close(true);
                break;
        }

        database.persistentStoreCollection.release();
    } catch (Throwable e) {
        database.logger.logSevereEvent("error closing log", e);

        result = false;
    }

    logInfoEvent("Database closed");

    log = null;

    appLog.close();
    sqlLog.close();

    logsStatements = false;
    loggingEnabled = false;

    return result;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:70,代码来源:Logger.java

示例3: close

/**
 *  Shuts down the logging process using the specified mode. <p>
 *
 * @param  closemode The mode in which to shut down the logging
 *      process
 *      <OL>
 *        <LI> CLOSEMODE_IMMEDIATELY performs SHUTDOWN IMMEDIATELY, equivalent
 *        to  a poweroff or crash.
 *        <LI> CLOSEMODE_NORMAL performs a normal SHUTDOWN that
 *        checkpoints the database normally.
 *        <LI> CLOSEMODE_COMPACT performs a shutdown compact that scripts
 *        out the contents of any CACHED tables to the log then
 *        deletes the existing *.data file that contains the data
 *        for all CACHED table before the normal checkpoint process
 *        which in turn creates a new, compact *.data file.
 *        <LI> CLOSEMODE_SCRIPT performs a SHUTDOWN SCRIPT.
 *      </OL>
 *
 * @return  true if closed with no problems or false if a problem was
 *        encountered.
 */
public boolean close(int closemode) {

    boolean result = true;

    if (log == null) {
        closeAllTextCaches(false);

        return true;
    }

    log.synchLog();
    database.lobManager.synch();

    try {
        switch (closemode) {

            case Database.CLOSEMODE_IMMEDIATELY :
                log.shutdown();
                break;

            case Database.CLOSEMODE_NORMAL :
                log.close(false);
                break;

            case Database.CLOSEMODE_COMPACT :
            case Database.CLOSEMODE_SCRIPT :
                log.close(true);
                break;
        }

        database.persistentStoreCollection.release();
    } catch (Throwable e) {
        database.logger.logSevereEvent("error closing log", e);

        result = false;
    }

    logInfoEvent("Database closed");

    log = null;

    appLog.close();
    sqlLog.close();

    logsStatements = false;
    loggingEnabled = false;

    return result;
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:70,代码来源:Logger.java

示例4: closeLog

/**
 *  Shuts down the logging process using the specified mode. <p>
 *
 * @param  closemode The mode in which to shut down the logging
 *      process
 *      <OL>
 *        <LI> closemode -1 performs SHUTDOWN IMMEDIATELY, equivalent
 *        to  a poweroff or crash.
 *        <LI> closemode 0 performs a normal SHUTDOWN that
 *        checkpoints the database normally.
 *        <LI> closemode 1 performs a shutdown compact that scripts
 *        out the contents of any CACHED tables to the log then
 *        deletes the existing *.data file that contains the data
 *        for all CACHED table before the normal checkpoint process
 *        which in turn creates a new, compact *.data file.
 *        <LI> closemode 2 performs a SHUTDOWN SCRIPT.
 *      </OL>
 *
 * @return  true if closed with no problems or false if a problem was
 *        encountered.
 */
public boolean closeLog(int closemode) {

    if (log == null) {
        appLog.sendLine(SimpleLog.LOG_ERROR, "Database closed");
        appLog.close();

        return true;
    }

    try {
        switch (closemode) {

            case Database.CLOSEMODE_IMMEDIATELY :
                log.shutdown();
                break;

            case Database.CLOSEMODE_NORMAL :
                log.close(false);
                break;

            case Database.CLOSEMODE_COMPACT :
            case Database.CLOSEMODE_SCRIPT :
                log.close(true);
                break;
        }
    } catch (Throwable e) {
        appLog.logContext(e, "error closing log");
        appLog.close();

        log = null;

        return false;
    }

    appLog.sendLine(SimpleLog.LOG_ERROR, "Database closed");
    appLog.close();

    log = null;

    return true;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:62,代码来源:Logger.java


注:本文中的org.hsqldb.Database.CLOSEMODE_NORMAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。