简体   繁体   中英

Sitecore.Analytics.Exceptions.ContactLockException while merging contacts

I am using Sitecore 8.0 update 5, While I try to Identify the contact using

Tracker.Current.Session.Identify(userKey);

I get the error

Sitecore.Analytics.Exceptions.ContactLockException

Adding the whole stack trace below

Exception: Sitecore.Analytics.Exceptions.ContactLockException
Message: Contact 1cd840a6-f367-4b5f-9df1-74240a03fd29 could not be locked in the XDB.
Source: Sitecore.Analytics
   at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName)
   at Test.Client.Common.Utilities.AnalyticsHelper.MergeContacts(String userKey)

This is code from Brain's Pedersen.

// THIS IS BAD!!!
// The user could be extranet\anonymous
if (!Tracker.IsActive)
  return;
Tracker.Current.Session.Identify(Sitecore.Context.User.Name);

// THIS COULD BE A SOLUTION:
if (!Tracker.IsActive)
  return;
if (Sitecore.Current.User.Name.ToLower() == "extranet\\anonymous")
  return;
Tracker.Current.Session.Identify(Sitecore.Context.User.Name);

// OR MAYBE THIS?
if (!Tracker.IsActive)
  return;
if (!Sitecore.Context.User.IsAuthenticated)
  return;
Tracker.Current.Session.Identify(Sitecore.Context.User.Name);

You can go through the link for more details. https://briancaos.wordpress.com/2015/07/02/sitecore-8-and-tracker-current-session-identify-overriding-expired-contact-session-lock-for-contact-id/

This seems to be an issue with your MongoDB. Check if it's running and if it's reachable to your IIS machine. Also check your log for Mongo erros.

Here is a similar issue: https://community.sitecore.net/developers/f/8/t/1771

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM