Monday, March 22, 2010

"Velocity" Part 1

It's just the CTP3 version, but it's nearly rough enough to put me off new technology for a while. I eventually got it set up on a single machine using SQL Server for its configuration mechanism, which necessitated creating a login, a database named "VelocityCacheConfig" and linking the login with a user "Velocity" who was db_datareader, db_datawriter and db_owner.

Pre-requisites: .NET 3.5 SP1 and Windows PowerShell.

You need to run the supplied PowerShell script as admin. Fair's fair. It's intended usage is to manage the cache cluster and you wouldn't want just anybody doing that.

There was some error message about the firewall.

It created a new region for every item added to the cache.

It took a long time to Remove-Cache and you can't New-Cache with the same cache name until the old one's removed. Get-CacheHelp lists the PowerShell cmdlets for working with the cache.

Need to add a reference to ClientLibrary.dll and CacheBaseLibrary.dll to your Visual Studio project.

Before running the following C#, you'd have to Start-CacheCluster, and Add-Cache "Test".

using Microsoft.Data.Caching;

DataCacheServerEndpoint[] endpoints = new DataCacheServerEndpoint[]
new DataCacheServerEndpoint("SCANDIUM", 22233, "DistributedCacheService")
DataCacheFactory factory = new DataCacheFactory(endpoints, true, false);
DataCache cache = factory.GetCache("Test");

No comments: