AW: [HACKERS] Q about read committed in Oracle...

From: Andreas Zeugswetter <andreas(dot)zeugswetter(at)telecom(dot)at>
To: "'vadim(at)krs(dot)ru'" <vadim(at)krs(dot)ru>
Cc: "hackers(at)postgreSQL(dot)org" <hackers(at)postgreSQL(dot)org>
Subject: AW: [HACKERS] Q about read committed in Oracle...
Date: 1998-07-30 09:32:44
Message-ID: 01BDBBAE.60A3E7E0@zeugswettera.user.lan.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vadim wrote:
>It's nice to see expected results but I still have some
>new questions - please help!

>1. CREATE TABLE test (x integer, y integer)
>2. INSERT INTO test VALUES (1, 1);
> INSERT INTO test VALUES (1, 2);
> INSERT INTO test VALUES (3, 2);
>3. run two session T1 and T2
>4. in session T2 run
> UPDATE test SET x = 1, y = 2 WHERE x <> 1 OR y <> 2;
2 rows updated.
>5. in session T1 run
> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
> UPDATE test SET y = 3 WHERE x = 1;
blocks
> --
> -- 1st record will be changed by T2, qual for new record
> -- version will be OK, but T1 should be aborted (???)
> --
>6. in session T2 run
> COMMIT;
>7. in session T1 run
> ROLLBACK; -- just to be sure -:)
UPDATE test SET y = 3 WHERE x = 1
*
ERROR at line 1:
ORA-08177: can't serialize access for this transaction
SQL> rollback;

Rollback complete.
>8. now in session T2 run
> UPDATE test SET x = 2;
3 rows updated.
>9. in session T1 run
> SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
> UPDATE test SET y = 4 WHERE x = 1 or x = 2;
blocks
>11. in session T2 run
> COMMIT;
Commit complete.
in T1: 3 rows updated.
>12. in session T1 run
> SELECT * FROM test; -- results?
> ^^^^^^^^^^^^^^^^^^
>I would like to be sure that T1 will update table...
X Y
---------- ----------
2 4
2 4
2 4

So it does.

Andreas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter T Mount 1998-07-30 10:08:58 CVS Problem holding up JDBC work
Previous Message Vadim Mikheev 1998-07-30 08:40:13 Re: [HACKERS] Q about read committed in Oracle...