Try fast search NHibernate

04 October 2009

NHibernate dialect for SQL Azure

As you read in this post there was a little problem running DAOs integration tests directly with SQL-Azure:

“Heaps can not be replicated tables. Please create a clustered index for the table.”

The problem is generated by this fact :

Because SQL Azure does not support heap tables, a table must have a clustered index. If a table is created without a clustered constraint, a clustered index must be created before an insert operation is allowed on the table.

How run SchemaExport and then run all integration tests having green-field ?

Easy with NHibernate extension points:

public class MsSqlAzureDialect : MsSql2008Dialect
{
public override string PrimaryKeyString
{
get { return "primary key CLUSTERED"; }
}
}
Happy NHibernating on the CLOUD!!

No comments:

Post a Comment