{"id":1656,"date":"2014-12-16T19:35:32","date_gmt":"2014-12-16T19:35:32","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=1656"},"modified":"2014-12-16T19:35:32","modified_gmt":"2014-12-16T19:35:32","slug":"introducing-nhibernate-couchbase-2nd-level-cache-provider","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/","title":{"rendered":"Introducing the NHibernate Couchbase 2nd Level Cache Provider"},"content":{"rendered":"<p>NHibernate has long supported the notion of a 2nd level caches, where query results are saved to an out-of-process cache for faster retrieval.\u00a0 The <a href=\"https:\/\/sourceforge.net\/projects\/nhcontrib\/\">NHContrib<\/a> project owns these caches, which include ASP.NET HttpCache, Velocity (AppFabric) and Memcached.\u00a0 That last cache &#8211; Memcached &#8211; is implemented using the Enyim.Caching library upon which the .NET Couchbase Client Library depends.\u00a0 Given that dependency and the fact that Couchbase is of course Memcached compatible, adding Couchbase to the set of available 2nd level caches for NHibernate seemed natural.<\/p>\n<p>I&#39;ve just finished porting the NHContrib Memcached provider to Couchbase.\u00a0 The new Couchbase cache is available on Couchbase Labs at https:\/\/github.com\/couchbaselabs\/nhibernate-caches-couchbase.\u00a0 It&#39;s plug and play and comes with a sample ASP.NET MVC project to demonstrate its usage.\u00a0 I&#39;ve detailed setup in the README.md file in the repository, but I&#39;ll point out some of the sample project config to give a sense of how to use it.<\/p>\n<p>In the sample, I use <a href=\"https:\/\/www.fluentnhibernate.org\/\">FluentNHibernate<\/a> for configuration.\u00a0 I won&#39;t describe FluentNHibernate here other than to say it allows you to configure NHibernate in code, instead of the standard set of XML files.\u00a0 In the sample project, I have a static class with a static method for configuring the client.<\/p>\n<div class=\"geshifilter\">\n<div class=\"csharp geshifilter-csharp\" style=\"font-family:monospace;\"><span style=\"color: #0600FF; font-weight: bold;\">public<\/span> <span style=\"color: #6666cc; font-weight: bold;\">class<\/span> FluentSession<br \/>\n<span style=\"color: #008000;\">{<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #0600FF; font-weight: bold;\">public<\/span> <span style=\"color: #0600FF; font-weight: bold;\">static<\/span> ISessionFactory CreateSessionFactory<span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #008000;\">{<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #6666cc; font-weight: bold;\">string<\/span> connectionString <span style=\"color: #008000;\">=<\/span> <span style=\"color: #666666;\">@&#8221;Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Beers.mdf;Integrated Security=True;User Instance=True&#8221;<\/span><span style=\"color: #008000;\">;<\/span><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #0600FF; font-weight: bold;\">return<\/span> Fluently<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Configure<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Database<\/span><span style=\"color: #008000;\">(<\/span>MsSqlConfiguration<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">MsSql2008<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">ConnectionString<\/span><span style=\"color: #008000;\">(<\/span>connectionString<span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">)<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #008000;\"><<\/span>strong<span style=\"color: #008000;\">>.<\/span><span style=\"color: #0000FF;\">Cache<\/span><span style=\"color: #008000;\">(<\/span>c <span style=\"color: #008000;\">=><\/span> c<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">UseQueryCache<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">ProviderClass<\/span><span style=\"color: #008000;\"><<\/span>CouchbaseCacheProvider<span style=\"color: #008000;\">><\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\"><\/<\/span>strong<span style=\"color: #008000;\">><\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Mappings<\/span><span style=\"color: #008000;\">(<\/span>m <span style=\"color: #008000;\">=><\/span>m<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">FluentMappings<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">AddFromAssemblyOf<\/span><span style=\"color: #008000;\"><<\/span>Beer<span style=\"color: #008000;\">><\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">)<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">ExposeConfiguration<\/span><span style=\"color: #008000;\">(<\/span>c <span style=\"color: #008000;\">=><\/span> c<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">SetProperty<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #666666;\">&#8220;current_session_context_class&#8221;<\/span>, <span style=\"color: #666666;\">&#8220;web&#8221;<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">)<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">BuildSessionFactory<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">;<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #008000;\">}<\/span><\/p>\n<p>\u00a0 \u00a0 <span style=\"color: #008000;\">&#8230;<\/span><br \/>\n<span style=\"color: #008000;\">}<\/span><\/div>\n<\/div>\n<p>The line relevant to the Couchbase cache provider is in the fluent .Cache call where, you&#39;re instructing NHibernate to cache queries and to cache them by using the new Couchbase caching provider.\u00a0 Beyond that, there&#39;s nothing specific about the Couchbase provider that needs to be configured.\u00a0 However, there are some other pieces necessary for using any 2nd level cache.\u00a0 You need to enable caching on the model class.<\/p>\n<p>So for my beer class:<\/p>\n<div class=\"geshifilter\">\n<div class=\"csharp geshifilter-csharp\" style=\"font-family:monospace;\"><span style=\"color: #0600FF; font-weight: bold;\">public<\/span> <span style=\"color: #6666cc; font-weight: bold;\">class<\/span> Beer<br \/>\n<span style=\"color: #008000;\">{<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #008000;\">[<\/span>Required<span style=\"color: #008000;\">]<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #0600FF; font-weight: bold;\">public<\/span> <span style=\"color: #0600FF; font-weight: bold;\">virtual<\/span> <span style=\"color: #6666cc; font-weight: bold;\">int<\/span> Id <span style=\"color: #008000;\">{<\/span> get<span style=\"color: #008000;\">;<\/span> set<span style=\"color: #008000;\">;<\/span> <span style=\"color: #008000;\">}<\/span><\/p>\n<p>\u00a0 \u00a0 <span style=\"color: #008000;\">[<\/span>Required<span style=\"color: #008000;\">]<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #0600FF; font-weight: bold;\">public<\/span> <span style=\"color: #0600FF; font-weight: bold;\">virtual<\/span> <span style=\"color: #6666cc; font-weight: bold;\">string<\/span> Name <span style=\"color: #008000;\">{<\/span> get<span style=\"color: #008000;\">;<\/span> set<span style=\"color: #008000;\">;<\/span> <span style=\"color: #008000;\">}<\/span><\/p>\n<p>\u00a0 \u00a0 <span style=\"color: #008000;\">[<\/span>Required<span style=\"color: #008000;\">]<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #0600FF; font-weight: bold;\">public<\/span> <span style=\"color: #0600FF; font-weight: bold;\">virtual<\/span> <span style=\"color: #6666cc; font-weight: bold;\">string<\/span> Brewery <span style=\"color: #008000;\">{<\/span> get<span style=\"color: #008000;\">;<\/span> set<span style=\"color: #008000;\">;<\/span> <span style=\"color: #008000;\">}<\/span><\/p>\n<p>\u00a0 \u00a0 <span style=\"color: #008000;\">[<\/span>Required<span style=\"color: #008000;\">]<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #0600FF; font-weight: bold;\">public<\/span> <span style=\"color: #0600FF; font-weight: bold;\">virtual<\/span> <span style=\"color: #6666cc; font-weight: bold;\">float<\/span> ABV <span style=\"color: #008000;\">{<\/span> get<span style=\"color: #008000;\">;<\/span> set<span style=\"color: #008000;\">;<\/span> <span style=\"color: #008000;\">}<\/span><br \/>\n<span style=\"color: #008000;\">}<\/span><\/div>\n<\/div>\n<p>I have to set the Cache option in the BeerMap.<\/p>\n<div class=\"geshifilter\">\n<div class=\"csharp geshifilter-csharp\" style=\"font-family:monospace;\"><span style=\"color: #0600FF; font-weight: bold;\">public<\/span> <span style=\"color: #6666cc; font-weight: bold;\">class<\/span> BeerMap <span style=\"color: #008000;\">:<\/span> ClassMap<span style=\"color: #008000;\"><<\/span>Beer<span style=\"color: #008000;\">><\/span><br \/>\n<span style=\"color: #008000;\">{<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #0600FF; font-weight: bold;\">public<\/span> BeerMap<span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #008000;\">{<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 Table<span style=\"color: #008000;\">(<\/span><span style=\"color: #666666;\">&#8220;Beers&#8221;<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">;<\/span><br \/>\n<span style=\"color: #008000;\"><<\/span>strong<span style=\"color: #008000;\">><\/span> \u00a0 \u00a0 \u00a0 \u00a0Cache<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">ReadWrite<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">;<\/span><\/p>\n<p><span style=\"color: #008000;\"><\/<\/span>strong<span style=\"color: #008000;\">><\/span> \u00a0 \u00a0 \u00a0 \u00a0Id<span style=\"color: #008000;\">(<\/span>b <span style=\"color: #008000;\">=><\/span> b<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Id<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">;<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 Map<span style=\"color: #008000;\">(<\/span>b <span style=\"color: #008000;\">=><\/span> b<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Name<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Not<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Nullable<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Length<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #FF0000;\">30<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">;<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 Map<span style=\"color: #008000;\">(<\/span>b <span style=\"color: #008000;\">=><\/span> b<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Brewery<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Not<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Nullable<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Length<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #FF0000;\">50<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">;<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 Map<span style=\"color: #008000;\">(<\/span>b <span style=\"color: #008000;\">=><\/span> b<span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">ABV<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Not<\/span><span style=\"color: #008000;\">.<\/span><span style=\"color: #0000FF;\">Nullable<\/span><span style=\"color: #008000;\">(<\/span><span style=\"color: #008000;\">)<\/span><span style=\"color: #008000;\">;<\/span><br \/>\n\u00a0 \u00a0 <span style=\"color: #008000;\">}<\/span><br \/>\n<span style=\"color: #008000;\">}<\/span><\/div>\n<\/div>\n<p>Something to keep in mind with any 2nd level cache and web projects.\u00a0 By default cache will be per request &#8211; not session.\u00a0 You need to configure an ASP.NET application to manage your sessions as described <a href=\"https:\/\/bengtbe.com\/blog\/2009\/10\/08\/nerddinner-with-fluent-nhibernate-part-3-the-infrastructure\/\">here<\/a>.\u00a0 If you don&#39;t configure your app in this way, you&#39;ll find that the cache is being recreated for every request- even within the same session. \u00a0<\/p>\n<p>So if you&#39;ve been waiting for a wicked fast and wicked scalable 2nd level caching solution for NHibernate, it&#39;s here.<\/p>\n<p>Please note that this provider is included as part of Couchbase Labs and is not an officially supported product.\u00a0 You&#39;re free to use the code however you&#39;d like as it&#39;s licensed under Apache License 2.0.\u00a0 The original project found in NHContrib is licensed under the LGPL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NHibernate has long supported the notion of a 2nd level caches, where query results are saved to an out-of-process cache for faster retrieval.\u00a0 The NHContrib project owns these caches, which include ASP.NET HttpCache, Velocity (AppFabric) and Memcached.\u00a0 That last cache [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[8980],"class_list":["post-1656","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Introducing the NHibernate Couchbase 2nd Level Cache Provider - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introducing the NHibernate Couchbase 2nd Level Cache Provider\" \/>\n<meta property=\"og:description\" content=\"NHibernate has long supported the notion of a 2nd level caches, where query results are saved to an out-of-process cache for faster retrieval.\u00a0 The NHContrib project owns these caches, which include ASP.NET HttpCache, Velocity (AppFabric) and Memcached.\u00a0 That last cache [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-16T19:35:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"John Zablocki, NET. SDK Developer, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Zablocki, NET. SDK Developer, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/\"},\"author\":{\"name\":\"John Zablocki, NET. SDK Developer, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/ee312fb775c13d20a32f1d455888a282\"},\"headline\":\"Introducing the NHibernate Couchbase 2nd Level Cache Provider\",\"datePublished\":\"2014-12-16T19:35:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/\"},\"wordCount\":556,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/\",\"name\":\"Introducing the NHibernate Couchbase 2nd Level Cache Provider - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2014-12-16T19:35:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introducing the NHibernate Couchbase 2nd Level Cache Provider\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/ee312fb775c13d20a32f1d455888a282\",\"name\":\"John Zablocki, NET. SDK Developer, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/201925d9efc4992ce80385b76fdea34b\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8c5a77152c796c424a3f7f6d9fa31a999a7fe115d64c2acc93c4c0c014e6512a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8c5a77152c796c424a3f7f6d9fa31a999a7fe115d64c2acc93c4c0c014e6512a?s=96&d=mm&r=g\",\"caption\":\"John Zablocki, NET. SDK Developer, Couchbase\"},\"description\":\"John Zablocki is a NET. SDK Developer at Couchbase. John is also the organizer of Beantown ALT.NET and a former adjunct at Fairfield University. You can also check out the book on Amazon named \\\"Couchbase Essentials\\\" which explains how to install and configure Couchbase Server.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/john-zablocki\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Introducing the NHibernate Couchbase 2nd Level Cache Provider - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/","og_locale":"en_US","og_type":"article","og_title":"Introducing the NHibernate Couchbase 2nd Level Cache Provider","og_description":"NHibernate has long supported the notion of a 2nd level caches, where query results are saved to an out-of-process cache for faster retrieval.\u00a0 The NHContrib project owns these caches, which include ASP.NET HttpCache, Velocity (AppFabric) and Memcached.\u00a0 That last cache [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/","og_site_name":"The Couchbase Blog","article_published_time":"2014-12-16T19:35:32+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"John Zablocki, NET. SDK Developer, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Zablocki, NET. SDK Developer, Couchbase","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/"},"author":{"name":"John Zablocki, NET. SDK Developer, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/ee312fb775c13d20a32f1d455888a282"},"headline":"Introducing the NHibernate Couchbase 2nd Level Cache Provider","datePublished":"2014-12-16T19:35:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/"},"wordCount":556,"commentCount":3,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/","url":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/","name":"Introducing the NHibernate Couchbase 2nd Level Cache Provider - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2014-12-16T19:35:32+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/introducing-nhibernate-couchbase-2nd-level-cache-provider\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Introducing the NHibernate Couchbase 2nd Level Cache Provider"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/ee312fb775c13d20a32f1d455888a282","name":"John Zablocki, NET. SDK Developer, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/201925d9efc4992ce80385b76fdea34b","url":"https:\/\/secure.gravatar.com\/avatar\/8c5a77152c796c424a3f7f6d9fa31a999a7fe115d64c2acc93c4c0c014e6512a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8c5a77152c796c424a3f7f6d9fa31a999a7fe115d64c2acc93c4c0c014e6512a?s=96&d=mm&r=g","caption":"John Zablocki, NET. SDK Developer, Couchbase"},"description":"John Zablocki is a NET. SDK Developer at Couchbase. John is also the organizer of Beantown ALT.NET and a former adjunct at Fairfield University. You can also check out the book on Amazon named \"Couchbase Essentials\" which explains how to install and configure Couchbase Server.","url":"https:\/\/www.couchbase.com\/blog\/author\/john-zablocki\/"}]}},"authors":[{"term_id":8980,"user_id":22,"is_guest":0,"slug":"john-zablocki","display_name":"John Zablocki, NET. SDK Developer, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/8c5a77152c796c424a3f7f6d9fa31a999a7fe115d64c2acc93c4c0c014e6512a?s=96&d=mm&r=g","author_category":"","last_name":"Zablocki","first_name":"John","job_title":"","user_url":"","description":"John Zablocki is a NET. SDK Developer at Couchbase. John is also the organizer of Beantown ALT.NET and a former adjunct at Fairfield University.\r\nYou can also check out the book on Amazon named \"Couchbase Essentials\" which explains how to install and configure Couchbase Server."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/1656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=1656"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/1656\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=1656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=1656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=1656"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}