Concurrent transaction problem

Поиск
Список
Период
Сортировка
От Ing. Michael Petroni
Тема Concurrent transaction problem
Дата
Msg-id 5.0.0.25.2.20001216125531.00a77eb0@pop.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Concurrent transaction problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi guys, I've some troubles with concurrent transactions on PgSql 7.0.3 on FreeBSD 3.2...
..can someone help about this case?

Thanx!


Session 0

At first let's create the table for our testcase and fill it with data...

tr_master=# create table seq (ch_name char(8), in_value integer not null default 0, primary key(ch_name));
NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'seq_pkey' for table 'seq'
CREATE
tr_master=# insert into seq values ('id_trans', 0);
INSERT 23438 1
tr_master=# \q


Session 1

After closing session 0 let's start a new one:

tr_master=# begin;
BEGIN
tr_master=# set transaction isolation level serializable;
SET VARIABLE
tr_master=# select * from seq;
 ch_name  | in_value
----------+----------
 id_trans |        0
(1 row)
tr_master=#


Session 2

We leave session 1 open and open another session 2 in a seperate shell:

tr_master=# begin;
BEGIN
tr_master=# set transaction isolation level serializable;
SET VARIABLE
tr_master=# select * from seq;
NOTICE:  current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
tr_master=#

This happens also without setting the isolation level to serialzable. Why? There's only read-access in both sessions? Shouldn't we even be able to update the record in Session 1 and Session 2 should bring up the old initial values of the row?

В списке pgsql-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Foreign Keys and OIDs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Concurrent transaction problem