I am having hard time testing the two phase commit.

Test case:
-- create a simple table
CREATE TABLE T1 ( A INT )

Then open two consoles (S1 = Session 1, S2 = Session 2 ) and set auto-commit off S1
-- S1: Insert a row, and check that S1 can see it
INSERT INTO T1 VALUES(1);
SELECT * FROM T1;
-- S2: Try to see the value, and as expected the table is locked
SELECT * FROM T1;
-> Timeout trying to lock table "T1";

-- S1: Prepare the commit
PREPARE COMMIT COM1;

As expected nothing has changed yet and S2 is still unable to select from T1

Then I Disconnect S1 so that it's connection is closed.

Now S2 is able to select from T1 and does not see the insert 1 since it was not committed.

But here is my problem.
SELECT * FROM INFORMATION_SCHEMA.IN_DOUBT
returns nothing.

I would have expected that COM1 would now be visible and IN_DOUBT but there is nothing.

- Rami

On 14.3.2013 14:48, Rami Ojares wrote:
Hi,

The last sentence of Two Phase Commit documentation is
"The database needs to be closed and re-opened to apply the changes "

I don't quite understand what changes this refers to.
Isn't it enough to execute COMMIT TRANSACTION transactionName to apply the changes?

- Rami

--
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