It didn't work as well as I thought...
Now I've tried to install the adapter and make it change the schema. Installing the adapter is not a problem. But making it update the schema is troublesome. You can see my source code in the previous post. It is expected that the Version Control Adapter will throw an exception when updating the warehouse. However, it is not expected that my own exceptions will be thrown. Here's what is happening in the event viewer when trying Run is performed from the warehouse web service:
Event Type: Error
Event Source: TFS Warehouse
Event Category: None
Event ID: 3000
Date: 12/6/2007
Time: 7:21:07 AM
User: N/A
Computer: ORCASBETA2_TFSV
Description:
TF53010: The following error has occurred in a Team Foundation component or extension:
Date (UTC): 12/6/2007 3:21:07 PM
Machine: ORCASBETA2_TFSV
Application Domain: /LM/W3SVC/1747463155/Root/Warehouse-4-128414278681842144
Assembly: Microsoft.TeamFoundation.Warehouse, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
Process Details:
Process Name: w3wp
Process Id: 3044
Thread Id: 3116
Account name: ORCASBETA2_TFSV\TFSSERVICE
Detailed Message: TF51209: A run-time error System.Exception: Transaction failed. Could not make schema changes!
at CodeMetricsAdapter.CMAdapter.MakeSchemaChanges()
at Microsoft.TeamFoundation.Warehouse.AdapterWrapper.MakeSchemaChanges() occurred on adapter CodeMetricsAdapter.CMAdapter.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
As expected, there was nothing to be found at the URL provided (as it apparently is with most documentation on TFS).
Here is the place where it fails in the MakeSchemaChanges() method:
try
{
// This will add the new fact and new dimension to the warehouse.
// If user wants to add new fields or measures to existing dimensions or facts in
// warehouse, then use the IDataStore.Add* methods. IDataStore.Add(config) will not
// work in that case.
// Also note that the Add method only appends the new facts and dimensions from the
// modified config. The current existing facts and dimensions will not get added twice.
m_dataStore.Add(config);
m_dataStore.CommitTransaction();
}
catch
{
m_dataStore.RollbackTransaction();
throw new Exception("Transaction failed. Could not make schema changes!");
}
It is, I suppose, the Add method in the datastore object that fails. I do wonder why though.
I feel completely stuck.