Re: [h2] H2 db getting corrupt on mac

2014-09-09 Thread Kam
It was my mistake in describing. we do use the BACKUP command and then 
since it produces a zip file, we create a new zip file and copy inputStream 
to another outputStream to create a new zip file (with some configs related 
to the DB) and then give that zip file to the customers to use as their 
backup. 
Maybe the issue happens while writing the zip file to another file or maybe 
it's during backup. We've yet to encounter why. 


On Monday, September 8, 2014 9:33:43 AM UTC-7, Thomas Mueller wrote:
>
> Hi,
>
> OK, now I'm not sure if you use the "backup" statement or not, because at 
> the beginning you wrote you don't ("We have a feature that backs up the 
> H2 DB file and zips it via java. the DB is in use when we back it up (all 
> it does is copy the h2 file)").
>
> If you use the "backup" statement, then the database shouldn't get 
> corrupt. If it does, then that would be a bug. I think we would need a 
> reproducible test case. If you can reproduce the issue with a new database, 
> could you try with H2 version 1.4.x? Version 1.4 should be more stable in 
> this area, because recovery is much simpler (but version 1.4 is still beta).
>
> Regards,
> Thomas
>

-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Database Hangs on schema update

2014-09-09 Thread D. Aldenderfer
When our application starts it performs schema updates to the H2 database 
as needed.

Before performing updates we "SET EXCLUSIVE 1"  and make sure that no table 
locks exists ( "SELECT COUNT(*) FROM information_schema.locks" ).

The following schema update statement hangs the application:

alter table ENCODED_ITEM add column if not exists TEXT_ENCODED_ITEM clob

Other "alter table add column" statements where the type is not clob do not 
display this behaviour?

We are using version 1.4.181

Any ideas?


-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Database Hangs on schema update

2014-09-09 Thread D. Aldenderfer
Further testing shows that when 'SET EXCLUSIVE 1' is NOT executed first, 
the statement runs normally.

On Tuesday, September 9, 2014 1:23:30 PM UTC-4, D. Aldenderfer wrote:
>
> When our application starts it performs schema updates to the H2 database 
> as needed.
>
> Before performing updates we "SET EXCLUSIVE 1"  and make sure that no 
> table locks exists ( "SELECT COUNT(*) FROM information_schema.locks" ).
>
> The following schema update statement hangs the application:
>
> alter table ENCODED_ITEM add column if not exists TEXT_ENCODED_ITEM clob
>
> Other "alter table add column" statements where the type is not clob do 
> not display this behaviour?
>
> We are using version 1.4.181
>
> Any ideas?
>
>
>

-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Re: Database Hangs on schema update

2014-09-09 Thread Noel Grandin
Can you either

(a) attach a debugger
(b) use ctrl-break in a command window
(c) connect with VisualVM

and generate a set of stack traces and locks of the active threads
when it is locked up?

Either that or a reproducible standalone test case.

Thanks.

-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Can huge delete statement execution in H2 cause JVM crash

2014-09-09 Thread Sanchand
In our project we execute sql files using Runscript.execute method of H2, 
during one such execution, there was large number of delete statement for a 
particular table in one of the sql file, the java utility handling the 
execution exited in during execution of that file. The utility ran 
successfully in few laptops but failed in failed in many exactly at the 
execution of that file. Please advice. 

-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Can huge delete statement execution in H2 cause JVM crash

2014-09-09 Thread thiloplanz
How exactly did the tool fail?

Did you get any error messages or stack traces?


-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Can huge delete statement execution in H2 cause JVM crash

2014-09-09 Thread Thomas Mueller
Hi,

Was there any kind of exception / stack trace?

Regards,
Thomas


On Wednesday, September 10, 2014, Sanchand  wrote:

> In our project we execute sql files using Runscript.execute method of H2,
> during one such execution, there was large number of delete statement for a
> particular table in one of the sql file, the java utility handling the
> execution exited in during execution of that file. The utility ran
> successfully in few laptops but failed in failed in many exactly at the
> execution of that file. Please advice.
>
> --
> 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 h2-database+unsubscr...@googlegroups.com
> 
> .
> To post to this group, send email to h2-database@googlegroups.com
> .
> Visit this group at http://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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Creating index causes wrong results for select with condition on indexed field

2014-09-09 Thread Thomas Mueller
Hi,

Yes, I can reproduce this problem. Thanks a lot for reporting! It happens
because of the (partially) descending index. It will be fixed in the next
release. A workaround is to use version 1.3.x, or (with 1.4.x), don't use
descending indexes.

Regards,
Thomas


On Monday, September 8, 2014, Damir Sultanbekov 
wrote:

> Small addition, I use h2 in Postgre mode, datasource is created as follows:
>
>  class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
> 
>  value="jdbc:h2:mem:test;MODE=PostgreSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"/>
> 
> 
> 
>
> понедельник, 8 сентября 2014 г., 10:56:45 UTC+6 пользователь Damir
> Sultanbekov написал:
>>
>> Hello.
>>
>> Recently I spend about 3 hours trying to debug very simple query.
>> I use spring-jdbc whith junit and h2 v1.4.181 (latest from Maven Central).
>>
>> First I initialize db with following scripts:
>>
>> -- DDL
>> create table leaderboard (
>> player_id integer not null,
>> type integer not null,
>> distance integer not null,
>> constraint pk_leaderboard primary key (player_id, type),
>> constraint chk_leaderboard_type check (type in (1, 2, 3))
>> );
>>
>> create index i_leaderboard_type_distance on leaderboard(type, distance
>> desc);
>>
>> -- Data
>> insert into leaderboard (player_id, type, distance) values (1, 1, 101);
>> insert into leaderboard (player_id, type, distance) values (1, 2, 201);
>> insert into leaderboard (player_id, type, distance) values (2, 1, 102);
>>
>>
>> Then I invoke following code from my unit-test:
>>
>> List list = jdbcTemplate.queryForList("select * from leaderboard");
>> System.out.println(" NONE: " + list);
>> list = jdbcTemplate.queryForList("select * from leaderboard where type =
>> 1");
>> System.out.println(" 1: " + list);
>>
>> And output is very strange:
>>  NONE: [{PLAYER_ID=1, TYPE=1, DISTANCE=101}, {PLAYER_ID=1, TYPE=2,
>> DISTANCE=201}, {PLAYER_ID=2, TYPE=1, DISTANCE=102}]
>>  1: []
>>
>> First query shows all three rows as expected, but second shows empty
>> result (2 rows expected).
>>
>> It tooks me about 3 hours to find out that index is the culprit. If I
>> remove 'create index' from DDL everything starts working:
>>
>>  NONE: [{PLAYER_ID=1, TYPE=1, DISTANCE=101}, {PLAYER_ID=1, TYPE=2,
>> DISTANCE=201}, {PLAYER_ID=2, TYPE=1, DISTANCE=102}]
>>  1: [{PLAYER_ID=1, TYPE=1, DISTANCE=101}, {PLAYER_ID=2, TYPE=1,
>> DISTANCE=102}]
>>
>> It looks like bug for me. Is it true?
>>
>  --
> 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 h2-database+unsubscr...@googlegroups.com
> 
> .
> To post to this group, send email to h2-database@googlegroups.com
> .
> Visit this group at http://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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.