Re: Hard problem with concurrency
| От | greg@turnstep.com | 
|---|---|
| Тема | Re: Hard problem with concurrency | 
| Дата | |
| Msg-id | 9ef65642a223696da0751ac72525ad10@biglumber.com обсуждение исходный текст | 
| Ответ на | Hard problem with concurrency ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>) | 
| Список | pgsql-hackers | 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Solution one: use sequences for the unique value.
Solution two: use another table to effect the exclusive locking 
and use it to store the "unique" values:
begin;
update row;
if (no rows affected) { lock table foo in exclusive mode; find a unique value that is not already in foo store this
valueinside of foo insert row;
 
}
commit;
Solution three: use your strategy two, but throw a loop around it and have 
it try again (with a new value) if it gets a unique violation.
- --
Greg Sabino Mullane  greg@turnstep.com
PGP Key: 0x14964AC8 200302162143
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html
iD8DBQE+T0sFvJuQZxSWSsgRAvMbAJwNndfcRb8U+W4TCeSGMGg+j7CqMwCgpfbd
98bDZI1r5AOLv1iCyVTC/AI=
=0Nkm
-----END PGP SIGNATURE-----
		
	В списке pgsql-hackers по дате отправления: