Re: lock row outside transaction, if not ...

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: lock row outside transaction, if not ...
Дата
Msg-id 642645.90203.qm@web31807.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на lock row outside transaction, if not ...  (Raimon Fernandez <coder@montx.com>)
Список pgsql-novice
> The customer data is selected, if we open a new transaction or not,
> we're currently in a transaction, as we are using the same connection
> to postgreSQL, so if the user before accepting the customer data
> changes, goes again to the invoice that he was modifing, and cancels
> de transaction, the data that was changed in the transaction of the
> customer, is lost.

I am not sure that I understand your question.  No matter how many transactions per connection,
you can still change what kinds of data are viewed by the customer.  I.e. you can let their
queries see only committed data or you can let them see un-committed data.  This is handled by
changing the transaction isolation level.

http://www.postgresql.org/docs/8.2/interactive/sql-set-transaction.html.

if you need something more that this there is listen/notify:

http://www.postgresql.org/docs/8.2/interactive/sql-listen.html
http://www.postgresql.org/docs/8.2/interactive/sql-notify.html

Also, if you just want to see if a tuple/row has changed before you update it, (so you can let the
customer know that they need to refresh their screenshot):
http://archives.postgresql.org/pgsql-novice/2007-02/msg00079.php

I hope this helps.
Regards,
Richard Broersma Jr.

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

Предыдущее
От: Raimon Fernandez
Дата:
Сообщение: lock row outside transaction, if not ...
Следующее
От: "Burak Seydioglu"
Дата:
Сообщение: Re: Processing Tables containing tree-like data