W dniu sobota, 7 maja 2011, 20:03:40 UTC+2 użytkownik David Cramer napisał:
>
> Would it help (in PG-world) at least if the selects where in 
> savepoints as well? 
>

In case you asked me - I don't know, I don't use PG on a daily basis...


Anyway, let me list some possible solutions to launch the discussion:
1. Leave it as is, and update the documentation to warn users that 
get_or_create is problematic for concurrent writes unless used in READ 
COMMITED isolation level
2. Switch to my code and update the documentation to warn users 
that get_or_create commits the open transaction
3. Combine 1&2 and somehow allow two modes of operation for get_or_create, 
either based on a flag, or based on retrieved isolation level - or maybe add 
some get_or_create2 ?
4. Remove get_or_create, because it cannot be fixed to gracefully handle all 
common cases

Re savepoint-based solution, I don't list it because I don't "feel" how it 
should work.

Tomasz

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to