Hi,

Yes, you could use (probably just after "analyze"):

        jt.execute("set trace_level_file 3");

So far, I could not reproduce the problem, my test case is:

    DeleteDbFiles.execute("~/temp", "test", false);
    String url = "jdbc:h2:~/temp/test";
    Connection conn = DriverManager.getConnection(url);
    Statement stat = conn.createStatement();
    stat.execute("create table if not exists test(id int, data clob)");
    for (int i = 0; i < 10; i++) {
        stat.execute("insert into test values(1, space(10000))");
        stat.execute("delete from test");
    }
    stat.execute("set trace_level_file 3");
    stat.execute("analyze");
    stat.execute("shutdown defrag");
    Backup.execute("~/temp/test.zip", "~/temp", "test", false);
    conn.close();

Regards,
Thomas

On Wednesday, May 11, 2016, Brett Ryan <[email protected]> wrote:

> That will produce one hell of a file.
>
> What I'm doing is taking a snapshot of a portion of another DB in the UK
> as a h2 database (well several) then sending that file to Australia to be
> used as a read only reference DB. The solution is sound it's the program
> that builds the DB that causes the problem. I've found that compacting
> (shutdown defrag) will go from 4GB to <800MB.
>
> Just checked and the built DB has 12,771,399 records which will only grow
> over time. It presently takes 20 minutes to create this file.
>
> Is there a way to turn tracing on at a certain point in time?
>
> The basic approach I take is of the following form where jt is an instance
> of spring's JdbcTemplate:
>
>         jt.execute((Connection con) -> {
>             RunScript.execute(con, new
> InputStreamReader(AppRunner.class.getResourceAsStream(s)));
>             return null;
>         });
>         syncTables();
>         // Would like to turn tracing on here.
>         jt.execute("analyze");
>         jt.execute("shutdown defrag");
>         Backup.execute("local_db.zip", ".", "local_db", false);
>
> On 11 May 2016, at 02:52, Thomas Mueller <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
> Hi,
>
> It looks like the store is closed while doing compaction. So it is
> probably closed twice (maybe concurrently). I'm not sure what could have
> caused this. I'm afraid we would need a reproducible test case.
>
> What might help is adding ";TRACE_LEVEL_FILE=3" to the database URL
> (everywhere), so all JDBC method calls are logged.
>
> Regards,
> Thomas
>
>
> On Tuesday, May 10, 2016, Brett Ryan <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
>> I'm trying to shutdown defrag a database followed by a backup. My tests
>> are when ran in isolation there is no problem, the problem seems to only
>> occur when ran from a windows scheduled task for some reason.
>>
>> When ran manually I am building a DB that is 4GB in size, after a defrag
>> this is reduced to < 800MB.
>>
>> I'm using h2 1.4.191.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "H2 Database" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/h2-database/TAlNnoWW0kI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected]
> <javascript:_e(%7B%7D,'cvml','h2-database%[email protected]');>
> .
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> Visit this group at https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <javascript:_e(%7B%7D,'cvml','h2-database%[email protected]');>
> .
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> Visit this group at https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to