1

Anyone know how to configure an ActiveRecord/nhibernate application to use Memcache as the 2nd level cache?

Paul
  • 1,457
  • 1
  • 19
  • 36
  • If you have specific issues with this setup I recommend creating a specific question with all relevant details... general questions will always get general answers. Also please note that StackOverflow is not a typical mailing list, it's a question/answer site. – Mauricio Scheffer Jun 21 '11 at 04:29

1 Answers1

2

Start with the ActiveRecord docs on second level cache configuration. Then, for specific information about Memcached, see this question.

You'll end up with a config similar to this:

<activerecord>      
  <config>
    <add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
    <add key="dialect" value="NHibernate.Dialect.MsSql2005Dialect" />
    <add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
    <add key="connection.connection_string" value="Data Source=.;Initial Catalog=test;Integrated Security=SSPI" />    
    <add key="cache.provider_class" value="NHibernate.Caches.MemCache.MemCacheProvider, NHibernate.Caches.MemCache"/>
    <add key="cache.use_second_level_cache" value="true"/>
    <add key="cache.use_query_cache" value="true"/>
  </config>      
</activerecord>
Community
  • 1
  • 1
Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275