Обсуждение: the lock mechanism

Поиск
Список
Период
Сортировка

the lock mechanism

От
"Sumaira Ali"
Дата:
hi,
 i found this piece of documentation on user locks in the postgresql source code in the file lock.c
"
User locks are handled totally on the application side as
* long term cooperative locks which extend beyond the normal
* transaction boundaries. Their purpose is to indicate to an
* application that someone is `working' on an item. So it is
* possible to put an user lock on a tuple's oid, retrieve the
* tuple, work on it for an hour and then update it and remove
* the lock. While the lock is active other clients can still
* read and write the tuple but they can be aware that it has
* been locked at the application level by someone."*/
could some one enlighten me on the meaning of " locked at application level in this context..!!
thanks
sumaira
 
 Tired of spam? Get advanced junk mail protection with MSN 8.

Re: the lock mechanism

От
Oliver Elphick
Дата:
On Tue, 2003-02-04 at 23:25, Sumaira Ali wrote:
> hi,
>  i found this piece of documentation on user locks in the postgresql
> source code in the file lock.c
> "
>
> User locks are handled totally on the application side as
...
>
> could some one enlighten me on the meaning of " locked at application
> level in this context..!!

It means your program knows about it, but PostgreSQL doesn't, except for
the purpose of telling your program.  If you use user locks, it is up to
you to have your program respect them; the database won't do it for you.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "That at the name of Jesus every knee should bow, of
      things in heaven, and things in earth, and things
      under the earth; And that every tongue should confess
      that Jesus Christ is Lord, to the glory of God the
      Father."              Philippians 2:10,11