Thursday, 20 November 2008

Why "ItemUpdated" fires 2 times ?

Problem:
I have a document library with an "ItemUpdated" item eventreceiver. Each time I upload a document, the eventreceiver fired 2 times in two different threads, with update conflicts as a concequens.

Cause:
When you use check-in/check-out on your document libraries the check-in action also fires an ItemUpdated event. If found this information here (good article!):

Solution:
We need to check which "ItemUpdated" we deal with ... the one from the check-in or the 'real' one. If found this code on the MS site to check the source of the event:

if (properties.AfterProperties["vti_sourcecontrolcheckedoutby"] == null && properties.BeforeProperties["vti_sourcecontrolcheckedoutby"] != null)
{
//This is when the update event is triggered by
check-in.
}
else
{
//This is triggered by events other than check-in
action.
}

Source: http://support.microsoft.com/kb/939307/en-us

Wednesday, 12 November 2008

Moss 2007 Database Migration - Diskspace Usage and Upgrade time

I'm currently working on a database migration SharePoint 2003 to Moss 2007.  One of my concerns was the diskspace usage during the migration.

In a previous post i wrote that a gradual upgrade can take up to  6,19 times the original diskspace.  So i had reasons to worry ...

I can tell you, a database migration takes less space, here are my test results:

DISKSPACE USAGE

Content Database 1 (+/- 12 GB)

  Before Migration After DB Migration
DATA File 11.706.624 kb 11.706.624 kb
LOG File 20.096 kb 1.219.712 kb

Logfile growth / data file = 10,42 %

Content Database 2 (+/- 58 GB)

  Before Migration After DB Migration
DATA File 58.035.584 kb 58.035.584 kb
LOG File 20.096 kb 9.930.624 kb

Logfile growth / data file = 17,11 %

Content Database 3 (+/- 18 GB)

  Before Migration After DB Migration
DATA File 17.139.776 kb 17.139.776 kb
LOG File 26.816 kb 1.321.088 kb

Logfile growth / data file = 7,71 %

UPGRADE TIME

The upgrade time of the DB migration depends on the hardware AND the features you want to activate during the migration.  I did a test activating the publishing features during the upgrade.

Database 1 - without publishing features : 15 minutes
Database 1 - with publishing features : 1 hour 40 minutes

Database 2 - without publishing features : not tested
Database 2 - with publishing features : 1 hour 53 minutes

Database 3 - without publishing features : 12 minutes
Database 3 - with publishing features : 51 minutes

CONCLUSIONS

  • The DATA file does not grow
  • The LOG file grows between 7% and 20% of the datafile
  • The upgrade time of the migration is short but depends on the features you want to activate during the upgrade.

Visual Studio 2010 Tools for SharePoint

A summary of what we can expect:

  • Server Explorer for SharePoint viewing Lists and other artifacts in SharePoint directly inside of Visual Studio

  • Windows SharePoint Services Project (WSP file) Import to create a new solution

  • Added a new web part project item and showed the Visual web part designer which loads a user control as a web part for SharePoint

  • Showed adding an event receiver for SharePoint and using the wizard to choose the event receiver and to just create a source file with that event receiver.

  • Added an ASPX workflow initiation form to a workflow project and showed how this workflow initiation form has designer capability

  • Showed the packaging explorer and the packaging editor which lets you structure the SharePoint features and WSP file that is created

Source:
http://blogs.msdn.com/pandrew/archive/2008/11/10/visual-studio-2010-tools-for-sharepoint-announced-at-teched-emea-developers-2008.aspx