Question on locking
От | Steve Tucknott |
---|---|
Тема | Question on locking |
Дата | |
Msg-id | 1099640185.1245.15.camel@retsol1 обсуждение исходный текст |
Ответы |
Re: Question on locking
Re: Question on locking Re: Question on locking |
Список | pgsql-novice |
PostGreSQL 7.4.5
If I have the situation where process 1 has selected record1 from table a for update and then process 2 tries to do the same, am I right in assuming that process 2 will wait until the first process completes the transaction (I've looked at Chapter 12 and this is intimated).
How can I detect the lock on process 2? I want to be able to tell the user that the row is tentatively locked and to allow them to abort the update attempt. I can't see a 'SET LOCK MODE TO NOT WAIT' style command, so how do I stop process 2 from waiting?
Is the suggested route to interrogate the system tables prior to selecting for update, to see if a lock has been applied?
Normally we wait on locks , so this is not an issue.
If I have the situation where process 1 has selected record1 from table a for update and then process 2 tries to do the same, am I right in assuming that process 2 will wait until the first process completes the transaction (I've looked at Chapter 12 and this is intimated).
How can I detect the lock on process 2? I want to be able to tell the user that the row is tentatively locked and to allow them to abort the update attempt. I can't see a 'SET LOCK MODE TO NOT WAIT' style command, so how do I stop process 2 from waiting?
Is the suggested route to interrogate the system tables prior to selecting for update, to see if a lock has been applied?
Normally we wait on locks , so this is not an issue.
Regards, Steve Tucknott ReTSol Ltd DDI: 01903 828769 |
В списке pgsql-novice по дате отправления: