提交 3226f510 authored 作者: christian.peter.io's avatar christian.peter.io

LOB: in server mode, if the feature "LOBs in database" is disabled, the…

LOB: in server mode, if the feature "LOBs in database" is disabled, the temporary files are now created in the temp directory (the same as when "LOBs in database" is enabled).
上级 f7deacda
......@@ -30,6 +30,9 @@ Change Log
using a database URL that doesn't start with "jdbc:h2:".
</li><li>Using the java.sql.Blob or java.sql.Clob interfaces could throw the wrong
exception after the object was closed.
</li><li>LOB: in server mode, if the feature "LOBs in database" is disabled,
the temporary files are now created in the temp directory (the same as
when "LOBs in database" is enabled).
</li></ul>
<h2>Version 1.2.147 (2010-11-21)</h2>
......
......@@ -241,6 +241,9 @@ public class ValueLob extends Value {
private int getNewObjectId(DataHandler h) {
String path = h.getDatabasePath();
if ((path != null) && (path.length() == 0)) {
path = new File(System.getProperty("java.io.tmpdir"), SysProperties.PREFIX_TEMP_FILE).getAbsolutePath();
}
int newId = 0;
int lobsPerDir = SysProperties.LOB_FILES_PER_DIRECTORY;
while (true) {
......@@ -381,8 +384,12 @@ public class ValueLob extends Value {
String compressionAlgorithm = h.getLobCompressionAlgorithm(type);
this.compression = compressionAlgorithm != null;
synchronized (h) {
String path = h.getDatabasePath();
if ((path != null) && (path.length() == 0)) {
path = new File(System.getProperty("java.io.tmpdir"), SysProperties.PREFIX_TEMP_FILE).getAbsolutePath();
}
objectId = getNewObjectId(h);
fileName = getFileNamePrefix(h.getDatabasePath(), objectId) + Constants.SUFFIX_TEMP_FILE;
fileName = getFileNamePrefix(path, objectId) + Constants.SUFFIX_TEMP_FILE;
tempFile = h.openFile(fileName, "rw", false);
tempFile.autoDelete();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论