wkim / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

[MVStore] java.lang.IllegalStateException: This map is closed [1.3.171] #456

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
H2 Version: svn trunk

Test:
==========================================
package my.test.mvstore;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class TestMapIsClosedException {
    public static void main(String[] args) throws SQLException {

        Connection conn = DriverManager.getConnection("jdbc:h2:tcp://localhost:9092/mydb", "sa", "");
        Statement stmt = conn.createStatement();

        stmt.executeUpdate("DROP TABLE IF EXISTS mvstore_test CASCADE");
        stmt.executeUpdate("CREATE TABLE IF NOT EXISTS mvstore_test(id int, name varchar(500), b boolean) "
                + "ENGINE \"org.h2.mvstore.db.MVTableEngine\"");
        stmt.executeUpdate("CREATE INDEX IF NOT EXISTS mvstore_test_index ON mvstore_test(name)");

        stmt.executeUpdate("insert into mvstore_test(id, name, b) values(10, 'a1', true)");
        stmt.executeUpdate("insert into mvstore_test(id, name, b) values(20, 'b1', true)");
        stmt.executeUpdate("insert into mvstore_test(id, name, b) values(30, 'a2', false)");
        stmt.executeUpdate("insert into mvstore_test(id, name, b) values(40, 'b2', true)");
        stmt.executeUpdate("insert into mvstore_test(id, name, b) values(50, 'a3', false)");
        stmt.executeUpdate("insert into mvstore_test(id, name, b) values(60, 'b3', true)");
        stmt.executeUpdate("insert into mvstore_test(id, name, b) values(70, 'b3', true)");

        ResultSet rs = stmt.executeQuery("select * from mvstore_test");
        int n = rs.getMetaData().getColumnCount();
        while (rs.next()) {
            for (int i = 1; i <= n; i++) {
                System.out.print(rs.getString(i) + " ");
            }
            System.out.println();
        }
        rs.close();
        stmt.close();
        conn.close();
    }
}
==========================================

Run:
===============
The first Run is OK,
but the second Run throws a java.lang.IllegalStateException。

Has been Repeating such laws: 
OK->IllegalStateException->OK->IllegalStateException->OK...

Exception Stacktrace:
===============
Exception in thread "main" org.h2.jdbc.JdbcSQLException: General error: 
"java.lang.IllegalStateException: This map is closed [1.3.171]" [50000-171]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
    at org.h2.message.DbException.get(DbException.java:158)
    at org.h2.message.DbException.convert(DbException.java:281)
    at org.h2.server.TcpServerThread.sendError(TcpServerThread.java:212)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:152)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalStateException: This map is closed [1.3.171]
    at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:632)
    at org.h2.mvstore.MVMap.checkOpen(MVMap.java:907)
    at org.h2.mvstore.MVMap.beforeWrite(MVMap.java:921)
    at org.h2.mvstore.MVMap.remove(MVMap.java:548)
    at org.h2.mvstore.db.TransactionStore.endTransaction(TransactionStore.java:274)
    at org.h2.mvstore.db.TransactionStore.commit(TransactionStore.java:259)
    at org.h2.mvstore.db.TransactionStore$Transaction.commit(TransactionStore.java:495)
    at org.h2.engine.Session.commit(Session.java:451)
    at org.h2.command.Command.stop(Command.java:146)
    at org.h2.command.Command.executeUpdate(Command.java:259)
    at org.h2.server.TcpServerThread.process(TcpServerThread.java:334)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:150)
    ... 1 more

    at org.h2.engine.SessionRemote.done(SessionRemote.java:568)
    at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:181)
    at org.h2.jdbc.JdbcStatement.executeUpdateInternal(JdbcStatement.java:125)
    at org.h2.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:110)
    at my.test.mvstore.TestMapIsClosedException.main(TestMapIsClosedException.java:15)

Original issue reported on code.google.com by zhh200...@gmail.com on 23 Apr 2013 at 2:49

GoogleCodeExporter commented 8 years ago
I didn't analyze it yet, but I will fix it.

Original comment by thomas.t...@gmail.com on 14 May 2013 at 7:42

GoogleCodeExporter commented 8 years ago
Should be fixed now (in the trunk)

Original comment by thomas.t...@gmail.com on 19 May 2013 at 4:55

GoogleCodeExporter commented 8 years ago
Fixed in version 1.3.172.

Original comment by thomas.t...@gmail.com on 25 May 2013 at 1:51