提交 71ec2fd8 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 c7400dc2
...@@ -87,7 +87,9 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2 ...@@ -87,7 +87,9 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
TestAll test = new TestAll(); TestAll test = new TestAll();
test.printSystem(); test.printSystem();
// int todoWriteTestThatCallsSystemHaltExtendTestLob;
// READ_CLOB, READ_BLOB
//create table test(id int, data array) //create table test(id int, data array)
//document array_get, array_length //document array_get, array_length
...@@ -103,7 +105,6 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2 ...@@ -103,7 +105,6 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
// D:\data\h2test\openjpa\openjpa-persistence-jdbc>mvn test // D:\data\h2test\openjpa\openjpa-persistence-jdbc>mvn test
// OSGi Bundle (see Forum) // OSGi Bundle (see Forum)
// QueryObjectFactory
// test with PostgreSQL Version 8.2 // test with PostgreSQL Version 8.2
......
...@@ -164,7 +164,7 @@ public class TestCases extends TestBase { ...@@ -164,7 +164,7 @@ public class TestCases extends TestBase {
Thread.sleep(500); Thread.sleep(500);
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
conn.close(); conn.close();
Thread.sleep(500); t.join(5000);
if(!stopped[0]) { if(!stopped[0]) {
error("query still running"); error("query still running");
} }
......
...@@ -33,7 +33,8 @@ public class TestLob extends TestBase { ...@@ -33,7 +33,8 @@ public class TestLob extends TestBase {
if(config.memory) { if(config.memory) {
return; return;
} }
testLobTransactions(); testLobTransactions(10);
testLobTransactions(10000);
testLobRollbackStop(); testLobRollbackStop();
testLobCopy(); testLobCopy();
testLobHibernate(); testLobHibernate();
...@@ -50,7 +51,7 @@ public class TestLob extends TestBase { ...@@ -50,7 +51,7 @@ public class TestLob extends TestBase {
testJavaObject(); testJavaObject();
} }
private void testLobTransactions() throws Exception { private void testLobTransactions(int spaceLen) throws Exception {
if(config.logMode == 0) { if(config.logMode == 0) {
return; return;
} }
...@@ -58,58 +59,60 @@ public class TestLob extends TestBase { ...@@ -58,58 +59,60 @@ public class TestLob extends TestBase {
Connection conn = reconnect(null); Connection conn = reconnect(null);
conn.createStatement().execute("CREATE TABLE TEST(ID IDENTITY, DATA CLOB, DATA2 VARCHAR)"); conn.createStatement().execute("CREATE TABLE TEST(ID IDENTITY, DATA CLOB, DATA2 VARCHAR)");
conn.setAutoCommit(false); conn.setAutoCommit(false);
Random random = new Random(1); Random random = new Random(0);
int rows = 0; int rows = 0;
Savepoint sp = null; Savepoint sp = null;
int len = getSize(100, 2000); int len = getSize(100, 400);
for(int i=0; i<len; i++) { for(int i=0; i<len; i++) {
switch(random.nextInt(10)) { switch(random.nextInt(10)) {
case 0: case 0:
// System.out.println("insert"); trace("insert");
conn.createStatement().execute("INSERT INTO TEST(DATA, DATA2) VALUES('"+i+"' || SPACE(10000), '"+i+"')"); conn.createStatement().execute("INSERT INTO TEST(DATA, DATA2) VALUES('"+i+"' || SPACE("+spaceLen+"), '"+i+"')");
rows++; rows++;
break; break;
case 1: case 1:
if(rows > 0) { if(rows > 0) {
// System.out.println("delete"); trace("delete");
conn.createStatement().execute("DELETE FROM TEST WHERE ID=" + random.nextInt(rows)); conn.createStatement().execute("DELETE FROM TEST WHERE ID=" + random.nextInt(rows));
} }
break; break;
case 2: case 2:
if(rows > 0) { if(rows > 0) {
// System.out.println("update"); trace("update");
conn.createStatement().execute("UPDATE TEST SET DATA='x' || DATA, DATA2='x' || DATA2 WHERE ID=" + random.nextInt(rows)); conn.createStatement().execute("UPDATE TEST SET DATA='x' || DATA, DATA2='x' || DATA2 WHERE ID=" + random.nextInt(rows));
} }
break; break;
case 3: case 3:
if(rows > 0) { if(rows > 0) {
// System.out.println("commit"); trace("commit");
conn.commit(); conn.commit();
sp = null; sp = null;
} }
break; break;
case 4: case 4:
if(rows > 0) { if(rows > 0) {
// System.out.println("rollback"); trace("rollback");
conn.rollback(); conn.rollback();
sp = null; sp = null;
} }
break; break;
case 5: case 5:
// System.out.println("savepoint"); trace("savepoint");
sp = conn.setSavepoint(); sp = conn.setSavepoint();
break; break;
case 6: case 6:
if(sp != null) { if(sp != null) {
// System.out.println("rollback to savepoint"); trace("rollback to savepoint");
conn.rollback(sp); conn.rollback(sp);
} }
break; break;
case 7: case 7:
if(rows > 0) { if(rows > 0) {
// System.out.println("shutdown"); trace("checkpoint");
conn.createStatement().execute("CHECKPOINT"); conn.createStatement().execute("CHECKPOINT");
trace("shutdown immediately");
conn.createStatement().execute("SHUTDOWN IMMEDIATELY"); conn.createStatement().execute("SHUTDOWN IMMEDIATELY");
trace("shutdown done");
conn = reconnect(null); conn = reconnect(null);
conn.setAutoCommit(false); conn.setAutoCommit(false);
sp = null; sp = null;
...@@ -337,7 +340,7 @@ public class TestLob extends TestBase { ...@@ -337,7 +340,7 @@ public class TestLob extends TestBase {
} }
} }
time = System.currentTimeMillis() - time; time = System.currentTimeMillis() - time;
// System.out.println("time: " + time +" compress: " + compress); trace("time: " + time +" compress: " + compress);
conn.close(); conn.close();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论