Answers.Body: <p>Tested on CiviCRM 4.7: two users can edit the same contact record, however, at the moment of saving the contact record, the second user to save the contact record will get a warning that the contact record has been modified by someone else. The user will then have an option to save anyway or reload the page.</p>
  
  <p><a href="https://i.sstatic.net/uAO43.png" rel="noreferrer"><img src="https://i.sstatic.net/uAO43.png" alt="Conflict editing the contact record"></a></p>
  
  <p>It also works with inline edit:</p>
  
  <p><a href="https://i.sstatic.net/fMktt.png" rel="noreferrer"><img src="https://i.sstatic.net/fMktt.png" alt="Inline edit conflict"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-24T15:16:48.320Z
Answers.Text: So if the 2nd user clicks "Save anyway" and the 1st user is still editing, and then the 1st user saves their changes, presumably they'll get the same warning, and by clicking "Save anyway" they'll potentially override the changes made by the 2nd user. The 2nd user doesn't know this. The 1st user never saw what the 2nd user did, so both users are in the dark. Wouldn't it be clearer if the 2nd user had no opportunity to even get to the edit screen until the 1st user had saved?
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-24T16:01:49.097Z
Answers.Text: The odds of having that type of edit conflict are (in my gut feeling) rather small. I have rarely had complaints about it from clients, but I understand that it can happen more frequently for some types of organisations/workflows. I think it would be a useful extension!
Answers.UserDisplayName: bgm
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-25T10:21:10.910Z
Answers.Text: Agreed, the probability may be small, but it remains a possibility. And the greater the number of active users and/or the lower the number of contact records in the database, the more likely it is for the issue to arise.
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T20:10:31.263Z
Answers.LastActivityDate: 2017-05-23T20:10:31.263Z
Answers.UserDisplayName: bgm
Answers.Body: <p>Here is an older thread with some changes that went into 4.3 (not sure if there have been further changes since then):</p>
  
  <ul>
  <li><a href="https://issues.civicrm.org/jira/browse/CRM-10553" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-10553</a> ("Implement contact-locking")</li>
  </ul>
  
  <blockquote>
    <p>Note: Initial discussions were held via email with followups on IRC on
    Monday (16-Jul-12) and Wednesday (18-Jul-12). An extra discussion
    document was included on Wed ( <a href="http://pastebin.com/BieCSzXa" rel="nofollow">http://pastebin.com/BieCSzXa</a> ). A blog
    post explored the issue further. Another IRC conversation (13-Aug-12)
    settled on optimistic locking.</p>
    
    <p>Some key design decisions:</p>
    
    <ol>
    <li>Locks are optimistic</li>
    <li>Locks apply coarsely to all core contact tables -- civicrm_contact, civicrm_address, civicrm_phone, civicrm_email, civicrm_website,
    civicrm_im, and single-value custom-data</li>
    <li>The key used to check revisions will be a "modified" timestamp on civicrm_contact</li>
    <li>Locks are only checked for the "Edit Contact" and "View Contact - Inline Edit" screens. Other screens will not read the "modified"
    timestamp or display warnings/errors about it; however, other screens
    will update the "modified" timestamp.</li>
    </ol>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-29T10:44:20.897Z
Answers.Text: Thanks for this. Can I assume then that in the case of, for example, editing an activity record, that no record locking takes place? And if so, can anyone cast any light on the potential implications?
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-28T19:17:25.773Z
Answers.LastActivityDate: 2016-04-28T19:17:25.773Z
Answers.UserDisplayName: Laryn
Answers.Body: <p>Can anyone confirm what record locking, if any, is implemented in CiviCRM 4.6 or 4.7?</p>
  
  <p>I swear I've seen a message which tells you someone else has the record open - are you sure you want to save changes, but I can't replicate it on our site.</p>
  
  <p>thanks
  Jon-man</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-14T11:08:01.393Z
Answers.Text: want to make this a separate question before folks start down voting it since it is not an answer
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-14T09:09:58.530Z
Answers.LastActivityDate: 2016-06-14T09:09:58.530Z
Answers.UserDisplayName: Jon-man
Body: <p>I'm assuming that the record is locked so that only one user - presumably the first - can edit, whilst others are locked out until the record has been saved. But I don't know, and a client has just raised the issue, so I'd like to provide a definitive answer.</p>
  
Tags: <database>
Title: How does CiviCRM handle multiple users editing the same record simultaneously?
ThreadText: # How does CiviCRM handle multiple users editing the same record simultaneously?
  
  (Asked by: username_0 on 2016-04-28)
  
  I'm assuming that the record is locked so that only one user - presumably the first - can edit, whilst others are locked out until the record has been saved. But I don't know, and a client has just raised the issue, so I'd like to provide a definitive answer.
  
  **Tags:** database
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2017-05-23. Score: 5
  
  Tested on CiviCRM 4.7: two users can edit the same contact record, however, at the moment of saving the contact record, the second user to save the contact record will get a warning that the contact record has been modified by someone else. The user will then have an option to save anyway or reload the page.
  
  [![Conflict editing the contact record](https://i.sstatic.net/uAO43.png)](https://i.sstatic.net/uAO43.png)
  
  It also works with inline edit:
  
  [![Inline edit conflict](https://i.sstatic.net/fMktt.png)](https://i.sstatic.net/fMktt.png)
  
  > **Comments:**
  > **username_0**: So if the 2nd user clicks "Save anyway" and the 1st user is still editing, and then the 1st user saves their changes, presumably they'll get the same warning, and by clicking "Save anyway" they'll potentially override the changes made by the 2nd user. The 2nd user doesn't know this. The 1st user never saw what the 2nd user did, so both users are in the dark. Wouldn't it be clearer if the 2nd user had no opportunity to even get to the edit screen until the 1st user had saved?  
  > **username_1**: The odds of having that type of edit conflict are (in my gut feeling) rather small. I have rarely had complaints about it from clients, but I understand that it can happen more frequently for some types of organisations/workflows. I think it would be a useful extension!  
  > **username_0**: Agreed, the probability may be small, but it remains a possibility. And the greater the number of active users and/or the lower the number of contact records in the database, the more likely it is for the issue to arise.  
  
  ---
  
  ### Answer by username_2 on 2016-04-28. Score: 2
  
  Here is an older thread with some changes that went into 4.3 (not sure if there have been further changes since then):
  
  * <https://issues.civicrm.org/jira/browse/CRM-10553> ("Implement contact-locking")
  
  > Note: Initial discussions were held via email with followups on IRC on
  > Monday (16-Jul-12) and Wednesday (18-Jul-12). An extra discussion
  > document was included on Wed ( <http://pastebin.com/BieCSzXa> ). A blog
  > post explored the issue further. Another IRC conversation (13-Aug-12)
  > settled on optimistic locking.
  >
  > Some key design decisions:
  >
  > 1. Locks are optimistic
  > 2. Locks apply coarsely to all core contact tables -- civicrm\_contact, civicrm\_address, civicrm\_phone, civicrm\_email, civicrm\_website,
  >    civicrm\_im, and single-value custom-data
  > 3. The key used to check revisions will be a "modified" timestamp on civicrm\_contact
  > 4. Locks are only checked for the "Edit Contact" and "View Contact - Inline Edit" screens. Other screens will not read the "modified"
  >    timestamp or display warnings/errors about it; however, other screens
  >    will update the "modified" timestamp.
  
  > **Comments:**
  > **username_0**: Thanks for this. Can I assume then that in the case of, for example, editing an activity record, that no record locking takes place? And if so, can anyone cast any light on the potential implications?  
  
  ---
  
  ### Answer by username_3 on 2016-06-14. Score: 0
  
  Can anyone confirm what record locking, if any, is implemented in CiviCRM 4.6 or 4.7?
  
  I swear I've seen a message which tells you someone else has the record open - are you sure you want to save changes, but I can't replicate it on our site.
  
  thanks
  username_3
  
  > **Comments:**
  > **username_4**: want to make this a separate question before folks start down voting it since it is not an answer  
  
  ---
  
  