Skip to main content

Posts

Showing posts with the label .net 4

Windows Azure AppFabric Service Bus Queues API

  Recently Microsoft released a new App Fabric SDK 2.0 CTP including some great new features, You can grab all the bits and pieces from here and/or read the release notes . Some of the highlights include:  Publish/Subscribe which are called Topics Message Queues Visual Studio Tools AppFabric Application Manager Support for running WCF & WF The part that interested me the most is the Queues feature and that is what I’m going to be exploring in this post. Overview of Queues Message Queues are not a new concept allow for more reliable and scalable communication between distributed systems than pure request/response. Solutions like MSMQ, NServiceBus already exist to solve this problem for locally connected systems.  What the Queues API provides is that it provides similar features but the messages are being transported across the internet and persisted in the cloud.   There is currently a Message Buffer available in Azure b...

Entity Framework 4 with Amazon RDS

  In my last post I demonstrated how you can use MySQL with Entity Framework 4. In this post I’m going to show you how to use Amazon RDS . Amazon RDS is a Relational Database Service which is similar to SQL Azure except that it supports MySQL & Oracle is coming soon. This is the actually the first time I’ve attempted to use the service and am going to be writing this as I go.  Amazon RDS takes care of all the critical database management tasks like software updates, backups & replication. Signing Up This post assumes you already have an AWS (Amazon Web Services) account, if you don’t go to the Sign In page. As with all Amazon Web Services you have to explicitly sign up, you can do this by going to http://aws.amazon.com/rds/ and clicking the “Sign Up For Amazon RDS” button. Note: Signing up is not instant, it took about 12 hours for me to receive the confirmation email. Launching the DB Instance Log into the AWS console and go to the Amazon RDS ta...

Using Entity Framework 4 with MySQL

  If you’re on the .NET Platform then MS SQL Server is usually the de-facto choice for the RDBMS. However if you’re at all cost conscience then you will realize that scaling and replication is going to cost you a fair chunk of change in licensing fees. For that reason open source RDBMSs and in particular MySQL offer a much cheaper alternative. In this post I’d like to demonstrate how you can use Entity Framework 4 with MySQL. MySQL Connector Net 6.3.6 The first thing you’ll need to do is download and install the latest version of the MySQL Connector for .NET from http://dev.mysql.com/downloads/connector/net/ Make sure that Visual Studio is closed when you install. Pascal Case Table Names Because we are going to generate our Entity Framework Model of an existing database we want to make sure that the entity names use pascal casing. By default MySQL on Windows forces lowercase table names. You can change this behaviour by adding lower_case_table_names=2 to your my.ini file...

Managing Change in Long Running Workflows Part 2

  Recently I wrote about how some of the Serialization problems you can face when dealing with long running workflows. In this post I’m going to cover how I deal with logic changes in persisted workflows and also how you can make logic changes to your workflows without having to deploy code. Hosting the Workflow When it comes to hosting your workflows there are really only two options to consider. Self-Hosting WCF Workflow Service To be honest I only looked at the WCF Workflow Service model briefly and decided it wasn’t the best fit for the requirements as it couldn’t provide the same benefits of self-hosting within a Workflow Application . Workflow Instance Store In order to persist Workflow instances you need to first create the Workflow Instance Store database. For this you will need to use the following scripts: C:\Windows\Microsoft.NET\Framework\v4.0.30319\SQL\en\SqlWorkflowInstanceStoreSchema.sql C:\Windows\Microsoft.NET\Framework\v4.0.30319\SQL\en\Sq...

Managing Change in Long Running Workflows Part 1

  I’ve been using Workflow Foundation now for over a year and it has become an integral part of our architecture and has by and large been very successful. However it is not without it’s issues, the single most being that official documentation is light at best and relevant blog posts are quite rare.   I recently ran into a fairly serious problem after deploying a new release of our Software. The Problem I received this lovely email from our exception tracker: System.Runtime.DurableInstancing.InstancePersistenceCommandException: The execution of the InstancePersistenceCommand named {urn:schemas-microsoft-com:System.Activities.Persistence/command}LoadWorkflow was interrupted by an error. ---> System.Runtime.Serialization.SerializationException: Deserialized object with reference id '73' not found in stream. The key part is “Deserialized object with reference id '73' not found in stream.” As I’m sure you can tell this does not really provide any helpful i...

Pre-Generating Views in Entity Framework .NET 4.0

  UPDATED ON: 16/09/2010 If you’re using Entity Framework chances are you’ve come up against performance issues already, especially when instantiating your Object Context. One very reliable way to increase performance is to pre-generate the Views. Depending on the size of your model and in my experience it can shave as much as 40% off the instantiation time. There is a good overview on MSDN , however it only covers .NET 3.5. Step 1 Go to your Model properties and select “ Copy to Output Directory ” for the Metadata Artifact Processing option. The result of this is you will end up with the .ssdl, .csdl and .msl files in your output directory which in this case is bin/Debug. Step 2 Next you need to setup the Pre-build event to use the EDMGen.exe tool. NB: If you use the Command on the MSDN site you will come across this error. “The required parameter ‘mode’ is missing” The correct command to use is: "%windir%\Microsoft.NET\Framework\ v4.0....