This problem occurs when the transaction is larger than the cache size.
Test case:
package db;
import java.io.*;
import java.sql.*;
import org.h2.tools.DeleteDbFiles;
import org.h2.util.IOUtils;
public class TestH2CachePerformance {
public static void main(String... args) throws Exception {
DeleteDbFiles.execute("data", null, true);
org.h2.Driver.load();
Connection conn = DriverManager.getConnection(
"jdbc:h2:data/test;CACHE_SIZE=100;TRACE_LEVEL_FILE=2");
conn.setAutoCommit(false);
Statement stat = conn.createStatement();
stat.execute("create table test(id identity, name varchar)");
stat.execute("insert into test select x, space(1024) " +
"from system_range(1, 1000)");
conn.commit();
conn.close();
String s = IOUtils.readStringAndClose(
new FileReader("data/test.trace.db"), -1);
if (s.indexOf("Cannot remove records") >= 0) {
throw new Exception();
}
}
}
Original issue reported on code.google.com by thomas.t...@gmail.com on 30 Dec 2009 at 10:59
Original issue reported on code.google.com by
thomas.t...@gmail.com
on 30 Dec 2009 at 10:59