PGDAC and Pessimistic Edit with AutoCommit
Posted: Wed 16 Mar 2016 12:39
Dear Support!
I tried to simulate EDB / SDAC pessimistic lock with autocommit mode.
The experience was:
1. I started two instance with one PGQuery(lmPessimistic).
2. I edit a row in App1.
3. I edit same row in App2.
4. I got lock obtaining error.
It was great. Then I tried two Queries (Q1, Q2).
1. I started two instance with 2 PGQueries (lmPessimistic) with locktest1, and locktest2 table.
2. I edit App1.Query1 row.
3. I edit App2.Query1 row - I got lock obtaining error.
4. I edit App1.Query2 row (then I have two App1 locked queries!)
5. I edit App2.Query2 row - I got lock obtaining error.
For this moment everything is fine.
But...
6. I post App1.Query2 row.
7. Then App2.Query2 row editing also causes lock obtaining error(!)
8. I post App1.Query1 row.
9. Then App2.Query2.Edit works.
So the problem that if I have two Queries as opened in A1, the A2 can't lock Q2 before all of them canceled or posted!
Is this based on PGSQL lock + AutoCommit, or is it a bug?
Thanks: dd
I tried to simulate EDB / SDAC pessimistic lock with autocommit mode.
The experience was:
1. I started two instance with one PGQuery(lmPessimistic).
2. I edit a row in App1.
3. I edit same row in App2.
4. I got lock obtaining error.
It was great. Then I tried two Queries (Q1, Q2).
1. I started two instance with 2 PGQueries (lmPessimistic) with locktest1, and locktest2 table.
2. I edit App1.Query1 row.
3. I edit App2.Query1 row - I got lock obtaining error.
4. I edit App1.Query2 row (then I have two App1 locked queries!)
5. I edit App2.Query2 row - I got lock obtaining error.
For this moment everything is fine.
But...
6. I post App1.Query2 row.
7. Then App2.Query2 row editing also causes lock obtaining error(!)
8. I post App1.Query1 row.
9. Then App2.Query2.Edit works.
So the problem that if I have two Queries as opened in A1, the A2 can't lock Q2 before all of them canceled or posted!
Is this based on PGSQL lock + AutoCommit, or is it a bug?
Thanks: dd