Welcome to WindowsClient.net | Sign in | Join

February 2008 - Posts

I haven't written many web services up to this point in my life, although I'm about to lead the development of a suite of services intended as an API for our solution. Because of this, the experience I've just had bothers me.

I knocked together a very simple web service for a client, with two methods, one to get some data and one to perform an update. They appeared to work fine, until they got down to some integration testing, at which point they started to throw intermittent exceptions.

A little bit of playing about from a Console app revealed that you could call the querying service as much as you liked, but as soon as you called the update service, the querying service stopped finding rows in the table. Obviously this is all remote and not on our servers, so debugging was basically impossible. I've spent the afternoon adding explicit transactions to the code, changing static declarations to instance, setting the TransactionOption property in the WebMethod attribute, all sorts. Finally my increasingly random searching threw up a 15 Seconds post about connection pooling, so I added "Pooling=False" to the connection string in the config file and that, annoyingly, fixed it.

I'm doubly annoyed now because I've made the problem go away without actually solving it: I don't know why or how pooling was causing the problem. There was no mention of transactions in the code to start with (it's a single update statement in a stored procedure), and when I added a transaction it was committed or rolled back immediately. All the SqlConnection, SqlCommand and SqlDataReader variables were neatly wrapped in using statements, so they should have been dead and gone by the time the service was recalled.

If anybody understands this better than me, please send your explanation on a postcard to "Confused, Tunbridge Wells".

JetBrains have started the Early Access Program for the new version of their ReSharper tool. 4.0 adds proper support for C# 3.0 features, stops highlighting the new syntactic sugar statements in red, and improves on a bunch of other features too. All the usual caveats about this being unstable software apply, but the best way to get it stable fast is to get using it and submitting issues through their JIRA database,

I only really discovered ReSharper recently while looking for a tool to automatically extract strings from code to a resource file, which the RGreatEx add-in does very nicely along with a bunch of other stuff. Don't know when they'll have a 4.0 compatible version out.

I was watching the Alex Heinrichs: Shipping Windows Server 2008 Channel 9 video on the train this morning, and he was talking about the most exciting feature being Server Core, which is probably true. And I got to thinking about WS2008 being Windows 6.1, and Vista SP1 being essentially the same kernel, and I went off on a mental tangent about Client Core, and whether that was an actual thing.

I came to the conclusion that it probably is, and I think that with Windows 7 we might see Client Core installs as an option. I can think of two applications off the top of my head: thin clients and web browsers. A desktop PC with only Remote Desktop installed could be low-spec and would be low-maintenance in terms of installation and patching, and there'd be the same "reduced attack surface" advantage that Server Core has.

Similarly for environments where a web browser is the only application - public internet points, those online-banking PCs in bank branches, interactive systems in shops - not having the rest of Windows installed would be cool. Although it would probably reduce the number of publicly visible blue screens of death in the world, which would be a bit of a shame...

Hi, I'm Mark. I'm a software architect/lead developer/product manager at a large software company in the UK. I'm currently leading the redevelopment of one of our major packages in .NET, and we've just switched over to VS2008 and Framework 3.5. It's a pretty good job, really, and I'm getting to do lots of problem-solving and framework engineering sorts of things along the way, so I thought I'd share some of the stuff I'm coming up with. Maybe some of it will be helpful. Maybe some of it will be wrong, and if it is, maybe you good people can let me know in the comments?

Also, random thoughts and links along the way. One coming up next...

 
Page view counter