Hi,

The setting LOCK_MODE is persistent, as documented:
http://h2database.com/html/grammar.html#set_lock_mode - so the setting is
stored in the database, and the next time you open it the same mode is
used. So you only need to set it to 3 once (not each time).

For import, CREATE TABLE AS SELECT has the same effect than LOG=0. So if
you use CREATE TABLE AS SELECT then you don't need to use LOG=0. LOG=0 will
only improve performance if you use INSERT INTO .. SELECT.

Regards,
Thomas



On Mon, Feb 11, 2013 at 6:02 PM, Ivan Staskov <[email protected]>wrote:

>  Hi,
>
>  I create H2DB as a file and import the huge amount of data with Fast
> Database Import options:
> http://www.h2database.com/html/performance.html#fast_import.
> "LOG=0;CACHE_SIZE=65536;LOCK_MODE=0;".
> After import of data I open connections with 'MULTI_THREADED=TRUE' option
> only for reading data.
> It worked in the one of the old version of h2DB ("h2-1.2.145.jar"), I
> didn't get any problem.
>
> Now, I'm using h2-1.3.164.jar. And my attempt to open connection with
> 'MULTI_THREADED=TRUE' option leads to Exception:
> > Cannot change the setting "LOCK_MODE=0 & MULTI_THREADED" when the
> database is already open; SQL statement:
> > SET MULTI_THREADED TRUE [90133-164]
>
> In the documentation for Fast Database Import I see: "Most of those
> options are not recommended for regular use, that means you need to reset
> them after use."
> Additionally I see that the same problems was already discussed here:
> https://groups.google.com/forum/?fromgroups=#!topic/h2-database/ZOw4ot12dRE
>
> My questions are:
> - How can I rest the options of Fast Database Import that stored in the
> h2db file?
> - Should I always set 'MULTI_THREADED=TRUE:LOCK_MODE=3' options (explicit
> set the 'default' option for LOCK_MODE)?
> It seems that it solve my problems, at least Exception is not thrown. Is
> it correct solution?
> - Why H2DB doesn't release the options of the old connections, perhaps
> exists some configuration to enable this mode?
>
> Thank you.
> Ivan
>
>  --
> 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 http://groups.google.com/group/h2-database?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to