You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library provides infrastructure support for using [Couchbase Server](http://couchbase.com) and ASP.NET.
5
5
6
+
- To request a feature or report a bug use [Jira](https://issues.couchbase.com/projects/CBASP).
7
+
- Gitter home is here: [](https://gitter.im/couchbaselabs/couchbase-aspnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
8
+
- Couchbase Forums for help is [here](https://forums.couchbase.com/c/net-sdk).
9
+
6
10
## Features:
7
11
8
12
ASP.NET SessionState Provider
9
13
10
-
* Updated to Couchbase .NET SDK 2.1!
14
+
* Updated to Couchbase .NET SDK 2.2!
11
15
* Port of the [Enyim Memcached Provider](https://github.com/enyim/memcached-providers) to Couchbase Server
12
16
13
17
## Requirements
14
18
15
19
* You'll need .NET Framework 4.5 or later to use the precompiled binaries.
16
20
* To build the client, you'll need Visual Studio > 2012 with MVC 4 to compile.
17
-
* The Nuget package for [Couchbase.NetClient 2.1.X](http://nuget.org/packages/CouchbaseNetClient) is referenced by Couchbase.AspNet
21
+
* The Nuget package for [Couchbase.NetClient 2.2.X](http://nuget.org/packages/CouchbaseNetClient) is referenced by Couchbase.AspNet
18
22
* Couchbase Server 2.5 or greater
19
23
20
24
## Application Startup
21
25
22
-
The first thing you will need to do is make sure you initialize the Couchbase Cluster using the ClusterHelper class in your Global.asax file:
23
-
24
-
protected void Application_Start()
25
-
{
26
-
ClusterHelper.Initialize("couchbase-caching");
27
-
28
-
...
29
-
}
26
+
***Note: its no longer required to initialize the ClusterHelper in global.asax or setup.cs to use the session or caching providers***
30
27
31
28
## Configuring the SessionState provider
32
29
30
+
Configure the Couchbase Client as you normally would:
Configure the Couchbase Client as you normally would:
57
+
**Important #1:** note that the name of the session provider ("couchbase-session") must match the name of the `CouchbaseClientSection`you defined earlier. The name can be anything you like but it must match so that the provider can lookup the couchbase configuration.
**Important #2:** the name of the bucket in the `sessionState` section ("my-memcached-bucket") must match the bucket name defined in the `CouchbaseClientSection `as well so during initialization the correct bucket is created.
52
60
53
61
If you would like to use a different bucket than the default one, you may do so by specifying a value for the "bucket" attribute of the provider entry (see below).
54
62
@@ -60,25 +68,17 @@ If you would like to use a different bucket than the default one, you may do so
60
68
61
69
If you would like to control the prefixes used to store data in the Couchbase bucket, you can change the default values (which are based on the application name and virtual path) with your own custom values. This will allow you to share session data between applications if you so desire.
If you would like to use a custom bucket factory, you may do so by specifying a value in the "factory" attribute of the provider entry. The example below sets it to the default factory, but you can replace this with your own factory class to have full control over the creation and lifecycle of the Couchbase client.
This session handler also supports the ability to disable exclusive session access for ASP.NET sessions if desired. You can set the value using the "exclusiveAccess" attribute of the provider entry.
If you would like to use a different bucket than the default one, you may do so by specifying a value for the "bucket" attribute of the provider entry (see below).
118
+
Update the outputCache section in Web.config as follows:
If you would like to control the prefix used to store data in the Couchbase bucket, you can change the default values (which are based on the application name and virtual path) with your own custom value. This will allow you to share cache data between applications if you so desire.
126
+
**Important #1:** note that the name of the caching provider ("couchbase-caching") must match the name of the `CouchbaseClientSection` you defined earlier. The name can be anything you like but it must match so that the provider can lookup the couchbase configuration.
127
+
128
+
**Important #2:** the name of the bucket in the `outputCache` section ("my-couchbase-bucket") must match the bucket name defined in the `CouchbaseClientSection `as well so during initialization the correct bucket is created.
130
129
131
-
<outputCache defaultProvider="CouchbaseCache">
130
+
If you would like to use a different bucket than the default one, you may do so by specifying a value for the "bucket" attribute of the provider entry (see below).
If you would like to use a custom bucket factory, you may do so by specifying a value in the "factory" attribute of the provider entry. The example below sets it to the default factory, but you can replace this with your own factory class to have full control over the creation and lifecycle of the Couchbase client.
138
+
If you would like to control the prefix used to store data in the Couchbase bucket, you can change the default values (which are based on the application name and virtual path) with your own custom value. This will allow you to share cache data between applications if you so desire.
From the Couchbase.AspNet directory, run nuget pack as follows:
159
160
`nuget pack .\Couchbase.AspNet.csproj`
161
+
162
+
163
+
##Change Log and Notes##
164
+
-`ICouchbaseBucketFactory` and `CouchbaseBucketFactory` have been made obsolete and are no longer used. Instead the provider will use the `CouchbaseConfigSection` as a factory to create the correct cluster and bucket objects.
165
+
-`ClusterHelper` is no longer used internally; the provider will create static `Cluster` and `CouchbaseBucket/MemcachedBucket` objects.
166
+
- A new parameter has been added to limit the number of retries that will occur if an `CouchbaseSessionStateProvider` item is locked with CAS. It's called `maxRetryCount` and defaults to `5`:
The Couchbase Caching and Session Providers is an open source software project which is depends upon community contributions and feedback. We welcome all forms of contribution good, bad or in-different!
0 commit comments