Re: [h2] Row disappears within the same transaction after a failed update (constraint violation)

2014-05-05 Thread Thomas Mueller
Hi, This should be fixed with the latest version of H2. Regards, Thomas On Thursday, April 17, 2014, Thomas Mueller thomas.tom.muel...@gmail.com wrote: Hi, By the way, a shorter SQL script test case: drop table test; create table test(id int primary key, a int unique, b int); set

[h2] Row disappears within the same transaction after a failed update (constraint violation)

2014-04-17 Thread Karl Gustafsson
Hi, When running an update that fails with an unique constraint violation, the row that I tried to update disappears for the remainder of the transaction. I cannot select it using its primary key or using the column that gave the constraint violation. Pseudo-SQL (all run within the same

Re: [h2] Row disappears within the same transaction after a failed update (constraint violation)

2014-04-17 Thread Noel Grandin
This is my initial analysis - I don't know how to solve it yet, but either someone else will, or I will get back to it at a later date. This problem appears to be specific to the combination of an in-memory database and MVCC=true, which is on by default in version 1.4.x The problem is

Re: [h2] Row disappears within the same transaction after a failed update (constraint violation)

2014-04-17 Thread Thomas Mueller
Hi, Thanks a lot for the test case! I can reproduce it using an in-memory database, with MVCC enabled. I think for the next version, I will disable the whole RegularTable / MultiVersionIndex / TreeIndex code, and use an in-memory MVStore instead. In the long run, this will allow us to reduce the

Re: [h2] Row disappears within the same transaction after a failed update (constraint violation)

2014-04-17 Thread Thomas Mueller
Hi, By the way, a shorter SQL script test case: drop table test; create table test(id int primary key, a int unique, b int); set autocommit false; insert into test values (1, 1, 1); insert into test values (2, 2, 2); -- gives a constraint violation update test set a = 1 where id = 2; -- the row