Skip to content

SHUTDOWN COMPACT does not compact anymore (2.3.239-SNAPSHOT) #4258

@naive924

Description

@naive924

Problem

Since H2 2.3.239 (master, self-built), the command:

SHUTDOWN COMPACT;

always ends with:

org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed [90121-239]

The database file size never shrinks and no .tempFile is created.

With H2 2.2.224 the same command works and the .mv.db file becomes smaller.

Steps to Reproduce

  1. Build from latest master:
    ./mvnw clean package -P assembly -DskipTests
    → h2-2.3.239-SNAPSHOT.jar
  2. Start H2 Shell and connect:
    java -cp h2-2.3.239-SNAPSHOT.jar org.h2.tools.Shell -url "jdbc:h2:file:./testdb"
  3. Insert and delete rows.
  4. Run:
    SHUTDOWN COMPACT;

Expected

Database file is compacted and shrinks.

Actual

Immediate "Database is already closed [90121-239]" error, file size unchanged.

Environment

  • H2 version: 2.3.239-SNAPSHOT (self-built from master)
  • Java: Corretto 11
  • OS: Windows 11 x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions