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

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Raimon Fernandez <coder(at)montx(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: lock row outside transaction, if not ...
Date: 2007-05-31 11:19:32
Message-ID: 642645.90203.qm@web31807.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Burak Seydioglu 2007-05-31 22:47:28 Re: Processing Tables containing tree-like data
Previous Message Raimon Fernandez 2007-05-31 10:19:08 lock row outside transaction, if not ...