提交 d6fdf873 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 391f3743
#Fri Oct 26 09:46:47 CEST 2007 #Fri Nov 09 12:31:47 CET 2007
benchmark.drivers.dir=C\:/data/java benchmark.drivers.dir=C\:/data/java
javac=javac javac=javac
path.servlet.jar=C\:/data/classpath/servlet-api.jar path.servlet.jar=C\:/data/classpath/servlet-api.jar
path.lucene.jar=C\:/data/classpath/lucene-core-2.2.0.jar path.lucene.jar=C\:/data/classpath/lucene-core-2.2.0.jar
version.name.maven=1.0.60 version.name.maven=1.0.61
jdk=1.4 jdk=1.4
...@@ -254,9 +254,7 @@ ...@@ -254,9 +254,7 @@
</target> </target>
<target name="javadocImpl"> <target name="javadocImpl">
<javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/test" destdir="bin" debug="true" includes="org/h2/test/bnf/*.java"/> <mkdir dir="docs/javadocImpl"/>
<javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/tools" destdir="bin" debug="true" includes="org/h2/tools/doclet/*.java"/>
<mkdir dir="docs/javadoc"/>
<javadoc <javadoc
sourcepath="src/main" sourcepath="src/main"
packagenames="org.h2.jdbc.*,org.h2.tools.*,org.h2.api.*,org.h2.store.*" packagenames="org.h2.jdbc.*,org.h2.tools.*,org.h2.api.*,org.h2.store.*"
......
...@@ -75,7 +75,7 @@ Example: ...@@ -75,7 +75,7 @@ Example:
&lt;dependency&gt; &lt;dependency&gt;
&lt;groupId&gt;com.h2database&lt;/groupId&gt; &lt;groupId&gt;com.h2database&lt;/groupId&gt;
&lt;artifactId&gt;h2&lt;/artifactId&gt; &lt;artifactId&gt;h2&lt;/artifactId&gt;
&lt;version&gt;1.0.60&lt;/version&gt; &lt;version&gt;1.0.61&lt;/version&gt;
&lt;/dependency&gt; &lt;/dependency&gt;
</pre> </pre>
</p> </p>
......
...@@ -15,10 +15,10 @@ H2 Database Engine ...@@ -15,10 +15,10 @@ H2 Database Engine
<h1>Downloads</h1> <h1>Downloads</h1>
<h3>Version 1.0.60 (2007-10-20, Current)</h3> <h3>Version 1.0.61 (2007-11-09, Current)</h3>
<p> <p>
<a href="http://www.h2database.com/h2-setup-2007-10-20.exe">Windows Installer</a><br /> <a href="http://www.h2database.com/h2-setup-2007-11-09.exe">Windows Installer</a><br />
<a href="http://www.h2database.com/h2-2007-10-20.zip">Platform-Independent Zip</a><br /> <a href="http://www.h2database.com/h2-2007-11-09.zip">Platform-Independent Zip</a><br />
</p> </p>
<h3>Download Mirror</h3> <h3>Download Mirror</h3>
......
...@@ -31,17 +31,17 @@ Welcome to H2, the free SQL database. The main feature of H2 are: ...@@ -31,17 +31,17 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
<table style="border: 0px; margin: 5px; background-color: #eee;"> <table style="border: 0px; margin: 5px; background-color: #eee;">
<tr><td style="border: 0px; background-color: #eee;" colspan="2"> <tr><td style="border: 0px; background-color: #eee;" colspan="2">
<h3>Download</h3> <h3>Download</h3>
Version 1.0.60 (2007-10-20): Version 1.0.61 (2007-11-09):
</td></tr> </td></tr>
<tr><td style="border: 0px; background-color: #eee;"> <tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-2007-10-20.exe"><img border="1" src="images/download.png" alt="download" /></a> <a href="http://www.h2database.com/h2-setup-2007-11-09.exe"><img border="1" src="images/download.png" alt="download" /></a>
</td><td style="vertical-align: middle; border: 0px; background-color: #eee;"> </td><td style="vertical-align: middle; border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-2007-10-20.exe">Windows Installer (2.8 MB)</a> <a href="http://www.h2database.com/h2-setup-2007-11-09.exe">Windows Installer (2.8 MB)</a>
</td></tr> </td></tr>
<tr><td style="border: 0px; background-color: #eee;"> <tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-2007-10-20.zip"><img border="1" src="images/download.png" alt="download" /></a> <a href="http://www.h2database.com/h2-2007-11-09.zip"><img border="1" src="images/download.png" alt="download" /></a>
</td><td style="vertical-align: middle; border: 0px; background-color: #eee;"> </td><td style="vertical-align: middle; border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-2007-10-20.zip">All platforms (zip, 3.9 MB)</a> <a href="http://www.h2database.com/h2-2007-11-09.zip">All platforms (zip, 3.9 MB)</a>
</td></tr> </td></tr>
<tr><td style="border: 0px; background-color: #eee;" colspan="2"> <tr><td style="border: 0px; background-color: #eee;" colspan="2">
<a href="download.html">All Downloads</a> <a href="download.html">All Downloads</a>
......
...@@ -1130,7 +1130,7 @@ Mit Maven 2 ...@@ -1130,7 +1130,7 @@ Mit Maven 2
#Downloads #Downloads
@download_1001_h3 @download_1001_h3
#Version 1.0.60 (2007-10-20, Current) #Version 1.0.61 (2007-11-09, Current)
@download_1002_a @download_1002_a
#Windows Installer #Windows Installer
...@@ -3122,7 +3122,7 @@ Mit Maven 2 ...@@ -3122,7 +3122,7 @@ Mit Maven 2
#Download #Download
@mainWeb_1007_td @mainWeb_1007_td
#Version 1.0.60 (2007-10-20): #Version 1.0.61 (2007-11-09):
@mainWeb_1008_a @mainWeb_1008_a
#Windows Installer (2.8 MB) #Windows Installer (2.8 MB)
......
...@@ -1130,7 +1130,7 @@ Afterwards, you can include the database in your Maven 2 project as a dependency ...@@ -1130,7 +1130,7 @@ Afterwards, you can include the database in your Maven 2 project as a dependency
Downloads Downloads
@download_1001_h3 @download_1001_h3
Version 1.0.60 (2007-10-20, Current) Version 1.0.61 (2007-11-09, Current)
@download_1002_a @download_1002_a
Windows Installer Windows Installer
...@@ -3122,7 +3122,7 @@ JDBC and (partial) ODBC API; Web Client application ...@@ -3122,7 +3122,7 @@ JDBC and (partial) ODBC API; Web Client application
Download Download
@mainWeb_1007_td @mainWeb_1007_td
Version 1.0.60 (2007-10-20): Version 1.0.61 (2007-11-09):
@mainWeb_1008_a @mainWeb_1008_a
Windows Installer (2.8 MB) Windows Installer (2.8 MB)
......
...@@ -1132,7 +1132,7 @@ Centralリポジトリの利用 ...@@ -1132,7 +1132,7 @@ Centralリポジトリの利用
ダウンロード ダウンロード
@download_1001_h3 @download_1001_h3
#Version 1.0.60 (2007-10-20, Current) #Version 1.0.61 (2007-11-09, Current)
@download_1002_a @download_1002_a
Windows Installer Windows Installer
...@@ -3124,7 +3124,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション ...@@ -3124,7 +3124,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション
ダウンロード ダウンロード
@mainWeb_1007_td @mainWeb_1007_td
#Version 1.0.60 (2007-10-20): #Version 1.0.61 (2007-11-09):
@mainWeb_1008_a @mainWeb_1008_a
#Windows Installer (2.8 MB) #Windows Installer (2.8 MB)
......
...@@ -375,7 +375,7 @@ build_1024_h3=Using Snapshot Version ...@@ -375,7 +375,7 @@ build_1024_h3=Using Snapshot Version
build_1025_p=To build a 'snapshot' H2 .jar file and upload it the to the local Maven 2 repository, execute the following command\: build_1025_p=To build a 'snapshot' H2 .jar file and upload it the to the local Maven 2 repository, execute the following command\:
build_1026_p=Afterwards, you can include the database in your Maven 2 project as a dependency\: build_1026_p=Afterwards, you can include the database in your Maven 2 project as a dependency\:
download_1000_h1=Downloads download_1000_h1=Downloads
download_1001_h3=Version 1.0.60 (2007-10-20, Current) download_1001_h3=Version 1.0.61 (2007-11-09, Current)
download_1002_a=Windows Installer download_1002_a=Windows Installer
download_1003_a=Platform-Independent Zip download_1003_a=Platform-Independent Zip
download_1004_h3=Download Mirror download_1004_h3=Download Mirror
...@@ -1039,7 +1039,7 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux) ...@@ -1039,7 +1039,7 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux)
mainWeb_1004_li=Embedded, Server and Cluster modes mainWeb_1004_li=Embedded, Server and Cluster modes
mainWeb_1005_li=JDBC and (partial) ODBC API; Web Client application mainWeb_1005_li=JDBC and (partial) ODBC API; Web Client application
mainWeb_1006_h3=Download mainWeb_1006_h3=Download
mainWeb_1007_td=Version 1.0.60 (2007-10-20)\: mainWeb_1007_td=Version 1.0.61 (2007-11-09)\:
mainWeb_1008_a=Windows Installer (2.8 MB) mainWeb_1008_a=Windows Installer (2.8 MB)
mainWeb_1009_a=All platforms (zip, 3.9 MB) mainWeb_1009_a=All platforms (zip, 3.9 MB)
mainWeb_1010_a=All Downloads mainWeb_1010_a=All Downloads
......
...@@ -66,7 +66,7 @@ public class ScriptCommand extends ScriptBase { ...@@ -66,7 +66,7 @@ public class ScriptCommand extends ScriptBase {
private byte[] buffer; private byte[] buffer;
private boolean tempLobTableCreated; private boolean tempLobTableCreated;
private int nextLobId; private int nextLobId;
private int lobBlockSize = Integer.MAX_VALUE; private int lobBlockSize = Constants.FILE_BLOCK_SIZE;
private static final String TEMP_LOB_FILENAME = "system_temp_lob.db"; private static final String TEMP_LOB_FILENAME = "system_temp_lob.db";
public ScriptCommand(Session session) { public ScriptCommand(Session session) {
...@@ -330,8 +330,8 @@ public class ScriptCommand extends ScriptBase { ...@@ -330,8 +330,8 @@ public class ScriptCommand extends ScriptBase {
for (int i = 0;; i++) { for (int i = 0;; i++) {
StringBuffer buff = new StringBuffer(lobBlockSize * 2); StringBuffer buff = new StringBuffer(lobBlockSize * 2);
buff.append("INSERT INTO SYSTEM_LOB_STREAM VALUES(" + id + ", " + i + ", NULL, '"); buff.append("INSERT INTO SYSTEM_LOB_STREAM VALUES(" + id + ", " + i + ", NULL, '");
int len = IOUtils.readFully(in, bytes, lobBlockSize); int len = IOUtils.readFully(in, bytes, 0, lobBlockSize);
if (len < 0) { if (len <= 0) {
break; break;
} }
buff.append(ByteUtils.convertBytesToString(bytes, len)); buff.append(ByteUtils.convertBytesToString(bytes, len));
......
...@@ -19,7 +19,8 @@ import org.h2.constant.SysProperties; ...@@ -19,7 +19,8 @@ import org.h2.constant.SysProperties;
* set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_01 * set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_01
* ant codeswitchJdk16 * ant codeswitchJdk16
* ant compile * ant compile
* ant javadocImpl * set classpath=
* ant javadocImpl (to find missing javadocs)
* ant codeswitchJdk14 * ant codeswitchJdk14
* ant javadocImpl * ant javadocImpl
* *
...@@ -70,8 +71,8 @@ import org.h2.constant.SysProperties; ...@@ -70,8 +71,8 @@ import org.h2.constant.SysProperties;
*/ */
public class Constants { public class Constants {
public static final int BUILD_ID = 60; public static final int BUILD_ID = 61;
private static final String BUILD = "2007-10-20"; private static final String BUILD = "2007-11-09";
public static final int VERSION_MAJOR = 1; public static final int VERSION_MAJOR = 1;
public static final int VERSION_MINOR = 0; public static final int VERSION_MINOR = 0;
......
...@@ -402,7 +402,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD ...@@ -402,7 +402,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
try { try {
debugCodeCall("getColumnDisplaySize", column); debugCodeCall("getColumnDisplaySize", column);
checkColumnIndex(column); checkColumnIndex(column);
return (int) result.getDisplaySize(--column); return result.getDisplaySize(--column);
} catch (Throwable e) { } catch (Throwable e) {
throw logAndConvert(e); throw logAndConvert(e);
} }
......
...@@ -290,6 +290,7 @@ public class LogFile { ...@@ -290,6 +290,7 @@ public class LogFile {
logSystem.addRedoLog(storage, recordId, blockCount, null); logSystem.addRedoLog(storage, recordId, blockCount, null);
storage.setRecordCount(storage.getRecordCount() - 1); storage.setRecordCount(storage.getRecordCount() - 1);
} else { } else {
logSystem.getOrAddSessionState(sessionId);
logSystem.addRedoLog(storage, recordId, blockCount, rec); logSystem.addRedoLog(storage, recordId, blockCount, rec);
storage.setRecordCount(storage.getRecordCount() + 1); storage.setRecordCount(storage.getRecordCount() + 1);
} }
...@@ -299,6 +300,7 @@ public class LogFile { ...@@ -299,6 +300,7 @@ public class LogFile {
logSystem.addRedoLog(storage, recordId, blockCount, rec); logSystem.addRedoLog(storage, recordId, blockCount, rec);
storage.setRecordCount(storage.getRecordCount() + 1); storage.setRecordCount(storage.getRecordCount() + 1);
} else { } else {
logSystem.getOrAddSessionState(sessionId);
logSystem.addRedoLog(storage, recordId, blockCount, null); logSystem.addRedoLog(storage, recordId, blockCount, null);
storage.setRecordCount(storage.getRecordCount() - 1); storage.setRecordCount(storage.getRecordCount() - 1);
} }
......
...@@ -171,6 +171,7 @@ public class LogSystem { ...@@ -171,6 +171,7 @@ public class LogSystem {
} }
void addUndoLogRecord(LogFile log, int logRecordId, int sessionId) { void addUndoLogRecord(LogFile log, int logRecordId, int sessionId) {
getOrAddSessionState(sessionId);
LogRecord record = new LogRecord(log, logRecordId, sessionId); LogRecord record = new LogRecord(log, logRecordId, sessionId);
undo.add(record); undo.add(record);
} }
...@@ -286,19 +287,13 @@ public class LogSystem { ...@@ -286,19 +287,13 @@ public class LogSystem {
} }
void setLastCommitForSession(int sessionId, int logId, int pos) { void setLastCommitForSession(int sessionId, int logId, int pos) {
Integer key = ObjectUtils.getInteger(sessionId); SessionState state = getOrAddSessionState(sessionId);
SessionState state = (SessionState) sessions.get(key);
if (state == null) {
state = new SessionState();
sessions.put(key, state);
state.sessionId = sessionId;
}
state.lastCommitLog = logId; state.lastCommitLog = logId;
state.lastCommitPos = pos; state.lastCommitPos = pos;
state.inDoubtTransaction = null; state.inDoubtTransaction = null;
} }
void setPreparedCommitForSession(LogFile log, int sessionId, int pos, String transaction, int blocks) { SessionState getOrAddSessionState(int sessionId) {
Integer key = ObjectUtils.getInteger(sessionId); Integer key = ObjectUtils.getInteger(sessionId);
SessionState state = (SessionState) sessions.get(key); SessionState state = (SessionState) sessions.get(key);
if (state == null) { if (state == null) {
...@@ -306,6 +301,11 @@ public class LogSystem { ...@@ -306,6 +301,11 @@ public class LogSystem {
sessions.put(key, state); sessions.put(key, state);
state.sessionId = sessionId; state.sessionId = sessionId;
} }
return state;
}
void setPreparedCommitForSession(LogFile log, int sessionId, int pos, String transaction, int blocks) {
SessionState state = getOrAddSessionState(sessionId);
// this is potentially a commit, so don't roll back the action before it (currently) // this is potentially a commit, so don't roll back the action before it (currently)
setLastCommitForSession(sessionId, log.getId(), pos); setLastCommitForSession(sessionId, log.getId(), pos);
state.inDoubtTransaction = new InDoubtTransaction(log, sessionId, pos, transaction, blocks); state.inDoubtTransaction = new InDoubtTransaction(log, sessionId, pos, transaction, blocks);
......
...@@ -80,7 +80,7 @@ public class FtpData extends Thread { ...@@ -80,7 +80,7 @@ public class FtpData extends Thread {
try { try {
OutputStream out = socket.getOutputStream(); OutputStream out = socket.getOutputStream();
InputStream in = fs.openFileInputStream(fileName); InputStream in = fs.openFileInputStream(fileName);
in.skip(skip); IOUtils.skipFully(in, skip);
IOUtils.copy(in, out); IOUtils.copy(in, out);
in.close(); in.close();
} finally { } finally {
......
...@@ -21,7 +21,7 @@ import org.h2.util.TempFileDeleter; ...@@ -21,7 +21,7 @@ import org.h2.util.TempFileDeleter;
/** /**
* This class is an abstraction of a random access file. * This class is an abstraction of a random access file.
* Each file contains a magic header, and reading / writing is done in blocks. * Each file contains a magic header, and reading / writing is done in blocks.
* See also {@link MemoryFileStore} and {@link SecureFileStore} * See also {@link SecureFileStore}
*/ */
public class FileStore { public class FileStore {
......
...@@ -4,11 +4,14 @@ ...@@ -4,11 +4,14 @@
*/ */
package org.h2.store.fs; package org.h2.store.fs;
import java.io.EOFException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import org.h2.util.IOUtils;
public class FileObjectZip implements FileObject { public class FileObjectZip implements FileObject {
private ZipFile file; private ZipFile file;
...@@ -47,10 +50,13 @@ public class FileObjectZip implements FileObject { ...@@ -47,10 +50,13 @@ public class FileObjectZip implements FileObject {
inPos = 0; inPos = 0;
} }
if (inPos < pos) { if (inPos < pos) {
in.skip(pos - inPos); IOUtils.skipFully(in, pos - inPos);
inPos = pos; inPos = pos;
} }
in.read(b, off, len); int l = IOUtils.readFully(in, b, off, len);
if (l != len) {
throw new EOFException();
}
pos += len; pos += len;
inPos += len; inPos += len;
} }
......
...@@ -174,23 +174,19 @@ public class IOUtils { ...@@ -174,23 +174,19 @@ public class IOUtils {
} }
} }
public static int readFully(InputStream in, byte[] buffer, int max) throws IOException { public static int readFully(InputStream in, byte[] buffer, int off, int max) throws IOException {
int off = 0, len = Math.min(max, buffer.length); int len = Math.min(max, buffer.length);
if (len == 0) { int result = 0;
return 0; while (len > 0) {
} int l = in.read(buffer, off, len);
while (true) {
int l = len - off;
if (l <= 0) {
break;
}
l = in.read(buffer, off, l);
if (l < 0) { if (l < 0) {
break; break;
} }
result += l;
off += l; off += l;
len -= l;
} }
return off <= 0 ? -1 : off; return result;
} }
public static int readFully(Reader in, char[] buffer, int max) throws IOException { public static int readFully(Reader in, char[] buffer, int max) throws IOException {
......
...@@ -253,8 +253,7 @@ public class ValueLob extends Value { ...@@ -253,8 +253,7 @@ public class ValueLob extends Value {
} }
int len = getBufferSize(handler, compress, remaining); int len = getBufferSize(handler, compress, remaining);
byte[] buff = new byte[len]; byte[] buff = new byte[len];
len = IOUtils.readFully(in, buff, len); len = IOUtils.readFully(in, buff, 0, len);
len = len < 0 ? 0 : len;
if (len <= handler.getMaxLengthInplaceLob()) { if (len <= handler.getMaxLengthInplaceLob()) {
byte[] small = new byte[len]; byte[] small = new byte[len];
System.arraycopy(buff, 0, small, 0, len); System.arraycopy(buff, 0, small, 0, len);
...@@ -306,7 +305,7 @@ public class ValueLob extends Value { ...@@ -306,7 +305,7 @@ public class ValueLob extends Value {
break; break;
} }
len = getBufferSize(handler, compress, remaining); len = getBufferSize(handler, compress, remaining);
len = IOUtils.readFully(in, buff, len); len = IOUtils.readFully(in, buff, 0, len);
if (len <= 0) { if (len <= 0) {
break; break;
} }
......
...@@ -149,6 +149,8 @@ java org.h2.test.TestAll timer ...@@ -149,6 +149,8 @@ java org.h2.test.TestAll timer
/* /*
implement & test: checkpoint commits running transactions
start writing javadocs for jdbcx package start writing javadocs for jdbcx package
toString() method to print something useful toString() method to print something useful
......
...@@ -121,7 +121,7 @@ public class TestHaltApp extends TestHalt { ...@@ -121,7 +121,7 @@ public class TestHaltApp extends TestHalt {
trace("committed: " + rowCount, null); trace("committed: " + rowCount, null);
} }
if ((flags & FLAG_NO_DELAY) != 0) { if ((flags & FLAG_NO_DELAY) != 0) {
if (random.nextInt(100) == 0) { if (random.nextInt(10) == 0 && (rowCount % 2 == 0)) {
execute(stat, "CHECKPOINT"); execute(stat, "CHECKPOINT");
} }
} }
......
...@@ -17,7 +17,6 @@ import java.util.Random; ...@@ -17,7 +17,6 @@ import java.util.Random;
import org.h2.store.fs.FileObject; import org.h2.store.fs.FileObject;
import org.h2.store.fs.FileSystem; import org.h2.store.fs.FileSystem;
import org.h2.store.fs.FileSystemMemory;
import org.h2.test.TestBase; import org.h2.test.TestBase;
public class TestFileSystem extends TestBase { public class TestFileSystem extends TestBase {
...@@ -25,10 +24,10 @@ public class TestFileSystem extends TestBase { ...@@ -25,10 +24,10 @@ public class TestFileSystem extends TestBase {
public void test() throws Exception { public void test() throws Exception {
testDatabaseInJar(); testDatabaseInJar();
testFileSystem(baseDir + "/fs"); testFileSystem(baseDir + "/fs");
testFileSystem(FileSystemMemory.MEMORY_PREFIX); testFileSystem(FileSystem.MEMORY_PREFIX);
// testFileSystem("jdbc:h2:mem:fs;TRACE_LEVEL_FILE=3"); // testFileSystem("jdbc:h2:mem:fs;TRACE_LEVEL_FILE=3");
testFileSystem("jdbc:h2:mem:fs"); testFileSystem("jdbc:h2:mem:fs");
testFileSystem(FileSystemMemory.MEMORY_PREFIX_LZF); testFileSystem(FileSystem.MEMORY_PREFIX_LZF);
testUserHome(); testUserHome();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论