提交 7de44b9e authored 作者: Thomas Mueller's avatar Thomas Mueller

The ChangeFileEncryption and Backup tools will now fail if the database is still…

The ChangeFileEncryption and Backup tools will now fail if the database is still in use. The Backup tool will also fail except when running in quiet mode.
上级 b0239c0b
......@@ -18,8 +18,8 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>The ChangeFileEncryption and Backup tools will now fail with an exception
if the database is still in use.
<ul><li>The ChangeFileEncryption tool will now fail with an exception
if the database is still in use. The Backup tool will also fail except when running in quiet mode.
</li><li>CSVREAD: when reading the column names from the CSV file, column names that contain
no special characters are considered case insensitive now.
</li><li>Optimization index conditions of the form 'column=NULL' (which is always false; unlike 'column IS NULL').
......
......@@ -25,7 +25,8 @@ import org.h2.util.Tool;
/**
* Creates a backup of a database.
* <br />
* The database must be closed before using this tool.
* The database must be closed before using this tool,
* except when running in quiet mode.
* @h2.resource
*/
public class Backup extends Tool {
......@@ -92,7 +93,9 @@ public class Backup extends Tool {
private void process(String zipFileName, String directory, String db, boolean quiet) throws SQLException {
ArrayList<String> list = FileLister.getDatabaseFiles(directory, db, true);
FileLister.tryUnlockDatabase(list, "backup");
if (!quiet) {
FileLister.tryUnlockDatabase(list, "backup");
}
if (list.size() == 0) {
if (!quiet) {
printNoDatabaseFilesFound(directory, db);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论