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

Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB,…

Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB, the error message "The object is already closed" was thrown.
上级 449880ff
......@@ -18,7 +18,9 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>ConvertTraceFile: the time in the trace file is now parsed as a long.
<ul><li>Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB,
the error message "The object is already closed" was thrown.
</li><li>ConvertTraceFile: the time in the trace file is now parsed as a long.
</li><li>Invalid connection settings are now detected.
</li><li>Issue 387: WHERE condition getting pushed into sub-query with LIMIT.
</li></ul>
......
......@@ -51,7 +51,8 @@ public class TcpServerThread implements Runnable {
private Thread thread;
private Command commit;
private SmallMap cache = new SmallMap(SysProperties.SERVER_CACHED_OBJECTS);
private SmallLRUCache<Long, CachedInputStream> lobs = SmallLRUCache.newInstance(SysProperties.SERVER_CACHED_OBJECTS);
private SmallLRUCache<Long, CachedInputStream> lobs =
SmallLRUCache.newInstance(SysProperties.SERVER_RESULT_SET_FETCH_SIZE * 2);
private int threadId;
private int clientVersion;
private String sessionId;
......
......@@ -32,10 +32,10 @@ import org.h2.store.FileLister;
import org.h2.store.fs.FileUtils;
import org.h2.test.TestBase;
import org.h2.tools.DeleteDbFiles;
import org.h2.util.Task;
import org.h2.util.Utils;
import org.h2.util.IOUtils;
import org.h2.util.StringUtils;
import org.h2.util.Task;
import org.h2.util.Utils;
import org.h2.value.ValueLob;
/**
......@@ -55,6 +55,7 @@ public class TestLob extends TestBase {
}
public void test() throws Exception {
testReadManyLobs();
testLobSkip();
testLobSkipPastEnd();
testCreateIndexOnLob();
......@@ -103,6 +104,29 @@ public class TestLob extends TestBase {
FileUtils.deleteRecursive(TEMP_DIR, true);
}
private void testReadManyLobs() throws Exception {
//
deleteDb("lob");
Connection conn;
conn = getConnection("lob");
Statement stat = conn.createStatement();
stat.execute("create table test(id identity, data clob)");
PreparedStatement prep = conn.prepareStatement(
"insert into test values(null, ?)");
byte[] data = new byte[256];
Random r = new Random(1);
for (int i = 0; i < 1000; i++) {
r.nextBytes(data);
prep.setBinaryStream(1, new ByteArrayInputStream(data));
prep.execute();
}
ResultSet rs = stat.executeQuery("select * from test");
while (rs.next()) {
rs.getString(2);
}
conn.close();
}
private void testLobSkip() throws Exception {
deleteDb("lob");
Connection conn;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论