Hi guys,
As part of a strategy for scalling out our Portal Sharepoint MySites which is over 250k mysites, we decided to create an approach which is:
1- Create a PowerShell custom Job which will run twice a month looking for unuseful mysites and remove them gradually.
2- The users which lost the mysite due custom Powershell job will be redirected into a common page for users that  does not edit their sites. It will avoid having too many mysites.
3- If the user over the common static home page decided to edit (Add new web parts, Add pages, etc) we need to create a personal mysite then.
All this is working except for the #3 which works partially.
When an user confirm its edition from a Sharepoint popup we will call a RESTFul service throught jQuery Ajax async in order to leave the service the task to create mysite while it shows a wait page upon the client side (the important thing here is the callback).
Above is the Ajax call. When this call is performed we need to assume the following:
1- The user already lost mysite due to auto-deletion from powershell script.
2- There is no personal site for this user calling the service.
3- We will create a site for the user.
So we are sure the site its not present, the rest ful function is:
This function is throwing out a PersonalSiteExistsException even when the site is not present.Â
When it works:
When I recycle the application pool after deleting personal sites, the exception is not trow and the site is created properly.
I guess  there is something in the cache but I cannot realize on what is causing the exception.
Could someone guide me¡
Thanks a lot.
?width=750
It was correct guys, after removing the cache it solved the issue.
So is it the deletion happen right away ? Might be the dave solution to bypass the cleanup one would be good since I do not want to wait the job deletion since I will create sites over and over again.
Hey guys, you all rock. Thanks for help me
Remove-SPSite –Identity "http://sitename" –GradualDelete:$False
try the above as it bypasses the timer job and then report back please
this will lists sites in the queue – Get-SPDeletedSite
Me
this will remove a specific one – Remove-SPDeletedSite -Identity 1f11a7e8-4e89-48ref-af8a-ad805a505753
public void Delete(
bool deleteADAccounts,
bool gradualDelete
)
?xgip=38%3A0%3A183%3A183%3B183%3B&width=32&height=32&crop=1%3A1
Thanks a lot Mark., I am looking through them right now.
We have a powershell script which is a custom job we’ve created. After a couple of checkings to see if the user is updating its Home Page into mysite, we proceed doing this:
$profile.PersonalSite.Delete();
So inmediately I proceed to create the site again, but it already exists, even if you check the personalsite instance of the user profile its empty. I noted that after recycling the app pool it works with no problems.
I am looking into the approaches you send me. I really appreaciate your help.
Regards.
Well his way of describing cache is not well communicated he means the site still exists (cache).
Now for the solution – Hugo – Can you run the timer job of mysite cleanup and gradual site delete before you recreate the Mysite using your Restful call?
As an update… Pretty sure its to do with a dodgy SPSite.Exists() method that get’s called internally in your method. There’s quite a bit on Google about it.Â
This comment by Chris Beckett is also really helpful :
It’s not a cache problem. In 2010 they implemented a timer job to do the actual site collection deletion called Gradual Site Deletion to help manage database locks when deleting large site collections. The actual deletion usually occurs very quickly, but it can take up to a few minutes.