提交 2a9fa06c authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation / formatting.

上级 18d0d751
......@@ -42,11 +42,11 @@ Change Log
</li><li>MVStore: a map implementation that supports concurrent operations.
</li><li>MVStore: unified exception handling; the version is included in the messages.
</li><li>MVStore: old data is now retained for 45 seconds by default.
</ul><li>MVStore: compress is now disabled by default, and can be enabled on request.
</ul><li>Support ALTER TABLE ADD ... AFTER. Patch from Andrew Gaul (argaul at gmail.com). Fixes issue 401.
</ul><li>Improved OSGi support. H2 now registers itself as a DataSourceFactory service. Fixes issue 365.
</ul><li>Add a DISK_SPACE_USED system function. Fixes issue 270.
</ul><li>Fix a compile-time ambiguity when compiling with JDK7, thanks to a patch from Lukas Eder.
</li><li>MVStore: compress is now disabled by default, and can be enabled on request.
</li><li>Support ALTER TABLE ADD ... AFTER. Patch from Andrew Gaul (argaul at gmail.com). Fixes issue 401.
</li><li>Improved OSGi support. H2 now registers itself as a DataSourceFactory service. Fixes issue 365.
</li><li>Add a DISK_SPACE_USED system function. Fixes issue 270.
</li><li>Fix a compile-time ambiguity when compiling with JDK7, thanks to a patch from Lukas Eder.
</li></ul>
<h2>Version 1.3.170 (2012-11-30)</h2>
......
......@@ -376,7 +376,7 @@ The following exceptions can occur:
</li><li><code>IllegalArgumentException</code> if a method was called with an illegal argument.
</li><li><code>UnsupportedOperationException</code> if a method was called that is not supported,
for example trying to modify a read-only map or view.
</ul>
</li></ul>
<h2 id="differences">Similar Projects and Differences to Other Storage Engines</h2>
<p>
......
......@@ -6,6 +6,7 @@
*/
package org.h2.store;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.sql.SQLException;
......@@ -88,6 +89,8 @@ public class RecoverTester implements Recorder {
new OutputStreamWriter(
FileUtils.newOutputStream(fileName + ".log", true)));
testDatabase(fileName, out);
} catch (IOException e) {
throw DbException.convertIOException(e, null);
} finally {
IOUtils.closeSilently(out);
testing = false;
......
......@@ -6,6 +6,7 @@
*/
package org.h2.tools;
import java.io.IOException;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.DriverManager;
......@@ -13,6 +14,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import org.h2.constant.ErrorCode;
import org.h2.engine.Constants;
import org.h2.message.DbException;
import org.h2.store.fs.FileUtils;
import org.h2.util.IOUtils;
import org.h2.util.JdbcUtils;
......@@ -147,6 +149,8 @@ public class CreateCluster extends Tool {
try {
scriptOut = FileUtils.newOutputStream(scriptFile, false);
Script.process(connSource, scriptOut);
} catch (IOException e) {
throw DbException.convertIOException(e, null);
} finally {
IOUtils.closeSilently(scriptOut);
}
......
......@@ -254,7 +254,11 @@ public class Recover extends Tool implements DataHandler {
fileName = fileName.substring(0, fileName.length() - 3);
String outputFile = fileName + suffix;
trace("Created file: " + outputFile);
try {
return new PrintWriter(IOUtils.getBufferedWriter(FileUtils.newOutputStream(outputFile, false)));
} catch (IOException e) {
throw DbException.convertIOException(e, null);
}
}
private void writeDataError(PrintWriter writer, String error, byte[] data) {
......
......@@ -6,6 +6,7 @@
*/
package org.h2.tools;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.sql.Connection;
......@@ -13,6 +14,7 @@ import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.h2.message.DbException;
import org.h2.store.fs.FileUtils;
import org.h2.util.IOUtils;
import org.h2.util.JdbcUtils;
......@@ -131,6 +133,8 @@ public class Script extends Tool {
try {
o = FileUtils.newOutputStream(fileName, false);
execute(url, user, password, o);
} catch (IOException e) {
throw DbException.convertIOException(e, null);
} finally {
IOUtils.closeSilently(o);
}
......
......@@ -104,6 +104,11 @@ public class MathUtils {
return cachedSecureRandom;
}
/**
* Generate a seed value, using as much unpredictable data as possible.
*
* @return the seed
*/
public static byte[] generateAlternativeSeed() {
try {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
......
......@@ -265,7 +265,8 @@ public abstract class TestBase {
} else {
url = name;
}
// url = addOption(url, "DEFAULT_TABLE_ENGINE", "org.h2.mvstore.db.MVTableEngine");
// url = addOption(url, "DEFAULT_TABLE_ENGINE",
// "org.h2.mvstore.db.MVTableEngine");
if (!config.memory) {
if (config.smallLog && admin) {
url = addOption(url, "MAX_LOG_SIZE", "1");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论