本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}