I have a basic question about concurrency.

Suppose I have a table Users, with a column email_address, and a view
that allows updating records from this table.

Suppose further that two different sessions, Alice and Bob, have loaded
the view on a specific record, say, record 15. The view shows the email
address in a text field that can be directly edited, and there is a
Save button. The current value of the email address is
'[EMAIL PROTECTED]', which both Alice and Bob see on their view.

Now Alice and Bob each edit the email address in the text field, but
they set it to different values; Alice sets it to
'[EMAIL PROTECTED]' and Bob sets it to '[EMAIL PROTECTED]'. Then
they both press save.

What will the value of the email_address field be afterwards? Will it
be determined by whoever pressed save last? Will the database detect
the problem? Can transactions extend across multiple requests, and if
so how? How would this interact with Django? By returning an error form
to one of the users (presumably the one who didn't save first)? Does it
matter whether the database is set to handle concurrency optimistically
(e.g., multi-version concurrency control) versus pessimistically (e.g.,
record locking)?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to