September 2007 - Posts
If you have never seen CodeRush in action you should check out the video in Jackie Goldstein’s blog post. This was created when he asked Kim Major to do a presentation.
The effect is pretty cool. Now I use Refactor and CodeRush but I am nowhere as fast as this, even with practice Guess I should study up on all the hotkeys as I saw quite a few I don’t know about.
BTW CodeRush and Refactor are created by Mark Miller, an amazing guy in more than one way
If you are developing your own workflow activities make sure you take a good look at the PersistOnClose attribute! If your activity does any work like changing a database its more than likely that you don't want to have the action executed twice. If the workflow runtime is stopped after your activity has completed without this attribute and is restarted later it will be restarted at the last persisted point, which is before your activity. The result being that your activity is executed again, not quite what you had in mind . The PersistOnClose attribute makes sure that the workflow state is persisted as soon as the activity has completed resulting in a consistent state even after a restart.
Of course the PersistOnClose attribute has a drawback and that is that the workflow runtime requires a Workflow persistence service, something you don't always want. In that case a work batch might be your friend. With a work batch the actual work is postponed until the workflow reached a persistence point. And the end of the workflow is always a persistence point
Some time ago I mentioned a quick and dirty way of cleaning out the SQL Server transaction log files on a development machine. This trick works perfectly well but Hugo, a fellow Dutch MVP, pointed out that in most cases it is far easier to just change the recovery model of a database to simple. Once done the transaction log is just bog enough to save the current transaction and this is discarded as soon as it is complete.
chancing the recovery model is easy, right click the database in the SQL Server Management Studio, select Properties, go to the options page and the recovery model is right at the top. Of course you can do it using a command: ALTER DATABASE <<Database Name>> SET RECOVERY SIMPLE
Earlier this week at the SDC conference I gave a presentation about the Sync Services for ADO.NET. Some attendees where pretty exited about this new possibility to sync data between a local data cache and some sever. Especially that they could use pretty much any database on the server as long as there is a managed provider. Now on the client side people where somewhat less thrilled that the only option seemed to be SQLce. In fact only a single person in the audience was currently using SQLce. Now I think SQLce is a very interesting product and could be used as a replacement for SQL Express in a fair number of applications so I suggest you take a look at it. However the good news is that Microsoft is planning on releasing a sample local provider for SQL Express on the client when Visual Studio 2008, Sync Services and SQL Server Compact are released.
Still I highly recommend taking a good look at SQLce as it is more that adequate in quite a few cases and it can make life a lot easier
Just a quick tip for when developing with SQL Server.
When doing a lot of updates in SQL the transaction log might grow quite large clogging up the disk and slowing things down. An easy and quick way to cleanup is to use:
backup log <<Database name>> with truncate_only
dbcc shrinkdatabase ( <<Database name>> )
Use the sp_databases stored procedure to see which database is getting big.
Warning: Keep in mind that the truncate_only option just dumps the transaction log so you do not want to do this on a production machine! But on a development machine where a database is just a test item it is a quick way to retrieve some disk space.