Showing posts with label Sitecore. Show all posts
Showing posts with label Sitecore. Show all posts

Wednesday, May 9, 2018

Sitecore Buckets and Improving bulk import speed

Hello.

I ran into a problem while trying to bulk insert items into a bucket in code, using the Glass Mapper SitecoreService - insert speed was very slow (10,000 items took 50 minutes). Deleting all items from the bucket was also fairly slow.

The solution in code is basically the same as the Powershell equivalent in the link above: -

            using (new Sitecore.Data.BulkUpdateContext())
            using (new SecurityDisabler()) // yes yes I know

            {
                foreach (var item in data)
                {
                    sitecoreService.Create(folderItem, item, false, true);
                }
            }

Yes I know I should be using a UserSwitcher instead of disabling all security..

Total import time down from 90 minutes to 6. Not bad :)


Thursday, January 12, 2017

CodeDen's - Sitecore Habitat Transformer

What is Sitecore Habitat ? 

It's an example implementation of the Helix design principles and conventions for a Sitecore project.

Dennis Lee has thoughtfully provided a nice and safe means of accelerating the process of re-implementing Habitat (the demo) in your own project.

Get it here


Thursday, June 4, 2015

Be careful what you delete for II - Judgment Day

A while back I posted this regarding deleting data from Sitecore's Analytics database.

TL;DR - Sitecore 6.4 (and possibly other versions using SQL-based analytics) do not want you to truncate the IPOwner table. Analytics stops working.



Lo and behold, we discover today that one of our Sitecore applications hasn't been collecting analytics for a while. Investigation of the database revealed - gasp - no data in the IPOwner table !!!

The Sitecore logs revealed a multitude of Foreign Key constraint violations; specifically the foreign key IP.IPOwnerID - IPOwner.IPOwnerID. It's trying to add a row to the IP table using an IPOwnerID that does not exist.

Wait, what ? There aren't any rows in IPOwner ?

Suspecting magic GUID foul play and thinking that Sitecore is perhaps expecting a row to be there, we crack open a fresh copy of Sitecore 6.4's OMS database and sure enough, hiding in there was this little fella: -

IpOwnerID Name Country VisitorIdentification ExternalUser
9F28FB1A-BDDA-4CE6-9521-D7E6C6D8BB9D (Pending) (Pending) 0


And it all makes sense. While waiting for MaxMind GeoIP service to return something, Sitecore is using this guy as the IPOwner for a new session until the queued service lookup completes (hopefully), so it can write some meaningful location data to the IP record.

Added this row.. tested the site.. analytics starts recording stuff !

So now we know. Delete all the IPOwner rows if you want, just make sure this row finds its way back in.

Wednesday, March 6, 2013

Sitecore - Illegal characters in path

Meh.


        /// checks for the existence of illegal characters in the URL, these being " < > | and SPACE
        /// for some reason Sitecore's Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions pipeline
        /// component doesn't handle the exception
        ///
        /// FilterUrlExtensions.Process > Sitecore.Web.RequestFilter.Process > RequestFilter.IsBlocked > RequestFilter.GetExtension
        ///     > System.IO.Path.GetExtension > System.IO.Path.CheckInvalidPathChars = where it goes bang, and isn't handled
        ///  
        /// This component fixes this behaviour by stripping illegal chars and then re-writing the URL using HttpContext.RewritePath
        ///
        /// Note that for some reason, if IIS Static File Compression is enabled for the site, this can cause resources to
        /// be returned to the browser with the correct encoding type (GZIP) but the browser fails to parse them
        ///
        /// Don't know why this is
        ///
        /// For this reason, the URL is only rewritten if the request URL contains these illegal chars


Let's just say this has caused problems with custom pipeline components I have worked on.

Friday, May 11, 2012

Be careful what you delete for...

Be very careful deleting stuff from a Sitecore Analytics database before you hand it over to your hosting company.

The usual approach is to clear the Page, PageEvent and Session tables because these will be full - many months worth of team dev, in my case - of locally registered page views. BUT - Don't get overzealous and delete the contents of the IPOwner table.

 Sitecore Analytics refused to do anything when I did this. Required inspection of the logs, which revealed a problem with some record not actually existing in IPOwner, even though a cursory inspection showed that this logged unique IP's for a session.

Delete these with extreme caution... because analytics stops working, period !

Saturday, November 20, 2010

SiteCore 6.4

SiteCore is a great .NET-based CMS.

I've seen so many CMS's, I'm frankly sick of them. Give me something useful and new. Hello, SiteCore. It's definitely better than Kentico, Umbraco, DotNetPuke, Sharepoint (ok not just a CMS but hey), OBS and even the legendary Pile of Code.

The Online Marketing Suite is the icing in the cake. I was in an OMS training day a few weeks ago and I thoroughly enjoyed it. Instrument your code; watch the marketing people have orgasms. Great stuff.

Thing is, the latest version 6.4 is still not going to *properly* support MVC or .NET 4. MVC I'm still out on; yes I know Model-View-Controller is a great pattern, not sure ASP.NET's version is that good though.

ASP.NET 4 WebForms is superb - please read this if you're not up to speed on the many new features it offers. Most ASP.NET developers are WebForms based, and MVC is a big paradigm shift for them. I know it allows a greater testing surface, amongst other benefits, but if you're doing your job properly and maybe following an MVP pattern in your web applications, then why switch ?

I think SiteCore have a fight on their hands; open-source competitors are going to eat into their share if they can't provide up to date development models, and frankly their licensing takes the piss. They want to charge us for staging licenses. Like.. what ??? Get bent guys..

The real question. Is Orchard the new messiah, or just a very naughty boy ?