0
votes

i m using fluent nHibernate in my project, now i want to apply ms velocity with fluent nHibernate, has anyone used velocity with fluent nHibernate ? if yes so how to get started with this thing ?

i have Google about this but didn't found any good stuff..

anyone have sample of configuration ?

Update: for Fluent configuration i did:

Fluently.Configure()
                .Database(MsSqlConfiguration.MsSql2008
                    .ConnectionString(c => c.FromConnectionStringWithKey("FNHConnection"))
                    )
                    .Cache(c=> c.UseQueryCache().ProviderClass((typeof(NHibernate.Caches.Velocity.VelocityProvider).AssemblyQualifiedName)))
                    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<User>()).BuildConfiguration()
                    .BuildSessionFactory();

but getting this exception:

Could not load type 'System.Data.Caching.CacheFactory' from assembly 'ClientLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.

What i m doing wrong ?

Thanks

1

1 Answers

1
votes

The NHibernate cache provider for Velocity/AppFabric will only work with the betas of AppFabric - it is, effectively, broken as the client assemblies used to contact an AppFabric cache were changed in the release version of AppFabric. The Velocity provider has not yet been updated to use the new assemblies.

However there is a workaround detailed in this question that walks you through updating the provider for AppFabric.