Kyle's life in technology

Sunday, April 10, 2005

Cache item expiration in ASP.NET

Made an interesting yet painfully-learned-the-hard-way lesson tonight.

When you give an absolute or sliding expiration to Cache item, the Cache does not remove the item immediately when the expiration is reached. Rather, it will remove it on the next attempt to access the item, and return null. I would also guess that expired items are removed when Cache does a sweep when it needs to free memory.

It makes sense now that I think about it. Never thought about it before :) ouch.

Wednesday, April 06, 2005

Subversion

Sometime in 2004, I started using Subversion on my PC as local source control. After a while, I had other people use my PC as version control for a project or two. Then a pilot effort on a test server at work, and now ...

... We've rolled Subversion out to the team on a permanent home on a Windows 2000 Server (we're running version 1.1.3 at the moment). We have a mass of source code in SourceSafe still though (and a little bit in ClearCase). For now, new projects are going in Subversion, and we will look to start migrating stuff. We're planning on doing a clean import though and not loading SS histories in SVN. We will leave the SS repositories up once migrated as read-only historical reference points.

I have to say SVN is truly awesome. I've been using it almost a year (prior to the 1.0 release) and never had an issue with data corruption. (Our main repo is at 1100 commits) SVN is very fast, even over VPN. The learning curve is much less than ClearCase (understand, not knocking ClearCase, but it does a lot more than we need it to and the learning curve to use it effectively isn't worth what we use it for).

We are using TortoiseSVN and ANKH as our SVN clients with a good deal of success. ANKH is not as mature as TortoiseSVN, but it does give you the convenience of most of your daily SVN tasks (update, commit, revert) right from the VS.NET IDE.The only thing I want is a .NET access library. I had an RSS feed for commits working that relied on a post-commit hook, but doesn't scale well when you get in the 1000's of commits range. I'd like to make an equivalent that accesses the repository directly, but there are very few options for accessing from .NET. ANKH uses pinvoke/managed C++ to access. Some other tools invoke the command line utils, which works, but is less than efficient.

I'm thinking of starting an access library for .NET, targeting informational access only (ie not for working copies or operations on working copies) -- rather repository & revision browsing. My thought now is to make an API set, and design it with pluggable access providers. The first access provider would be a wrapper to the command line utils. The second would be an implementation of the native SVN protocol used by svnserve, since this is what we are using. Maybe eventually a WebDAV provider. (Command line version would be fallback for Apache-based svn servers and/or svn+ssh servers.) Would at least be a good way to learn the innards of Subversion.