-----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-----