Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: master
...
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 11 files changed
  • 0 commit comments
  • 1 contributor
View
BIN  NHibernate.Caches/Lib/net/3.5/Iesi.Collections.dll
Binary file not shown
View
BIN  NHibernate.Caches/Lib/net/3.5/NHibernate.dll
Binary file not shown
View
BIN  NHibernate.Caches/Lib/net/3.5/ServiceStack.Common.dll
Binary file not shown
View
BIN  NHibernate.Caches/Lib/net/3.5/ServiceStack.Interfaces.dll
Binary file not shown
View
BIN  NHibernate.Caches/Lib/net/3.5/ServiceStack.Redis.dll
Binary file not shown
View
BIN  NHibernate.Caches/Lib/net/3.5/ServiceStack.Text.dll
Binary file not shown
View
BIN  NHibernate.Caches/Lib/net/3.5/nunit.framework.dll
Binary file not shown
View
2  NHibernate.Caches/Redis/NHibernate.Caches.Redis.Tests/NHRedisClientNoClearFixture.cs
@@ -36,7 +36,7 @@ public class NhRedisClientNoClearFixture : NhRedisClientFixture
{
private readonly int _lockTimeout = 2;
[TestFixtureSetUp]
- public void FixtureSetup()
+ public override void FixtureSetup()
{
XmlConfigurator.Configure();
_props = new Dictionary<string, string> {{RedisProvider.NoClearPropertyKey, "true"},
View
11 NHibernate.Caches/Redis/NHibernate.Caches.Redis.Tests/NHibernate.Caches.Redis.Tests.csproj
@@ -33,17 +33,20 @@
<ItemGroup>
<Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\nhibernateTR\nhibernate\lib\net\3.5\Iesi.Collections.dll</HintPath>
+ <HintPath>..\..\Lib\net\3.5\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\net\3.5\log4net.dll</HintPath>
</Reference>
- <Reference Include="NHibernate, Version=3.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
+ <Reference Include="NHibernate, Version=3.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\net\3.5\NHibernate.dll</HintPath>
</Reference>
- <Reference Include="nunit.framework, Version=2.5.8.10295, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
+ <Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\Lib\net\3.5\nunit.framework.dll</HintPath>
+ </Reference>
<Reference Include="ServiceStack.Client, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\net\3.5\ServiceStack.Client.dll</HintPath>
@@ -56,7 +59,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\net\3.5\ServiceStack.Interfaces.dll</HintPath>
</Reference>
- <Reference Include="ServiceStack.Redis, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <Reference Include="ServiceStack.Redis, Version=2.2.0.25055, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\net\3.5\ServiceStack.Redis.dll</HintPath>
</Reference>
View
27 NHibernate.Caches/Redis/NHibernate.Caches.Redis/NHRedisClientNoClear.cs
@@ -30,6 +30,7 @@
using ServiceStack.Redis;
using ServiceStack.Redis.Pipeline;
using ServiceStack.Redis.Support;
+using ServiceStack.Redis.Support.Locking;
using ServiceStack.Redis.Support.Queue.Implementation;
namespace NHibernate.Caches.Redis
@@ -293,10 +294,21 @@ public override void Lock(object key)
{
using (var disposable = new PooledRedisClientManager.DisposablePooledClient<SerializingRedisClient>(ClientManager))
{
- long lockExpire = disposable.Client.Lock(CacheNamespace.GlobalKey(key, RedisNamespace.NumTagsForLockKey), _lockAcquisitionTimeout, _lockTimeout);
- bool rc = (lockExpire != 0);
- if (rc)
- AcquiredLocks[key] = lockExpire;
+ long lockExpire = 0;
+ var aLock = new DistributedLock();
+ var globalKey = CacheNamespace.GlobalKey(key, RedisNamespace.NumTagsForLockKey);
+ try
+ {
+ long rc = aLock.Lock(globalKey, _lockAcquisitionTimeout, _lockTimeout, out lockExpire, disposable.Client);
+ if (rc != DistributedLock.LOCK_NOT_ACQUIRED)
+ AcquiredLocks[key] = lockExpire;
+ }
+ catch (Exception)
+ {
+ if (lockExpire != 0)
+ aLock.Unlock(globalKey, lockExpire, disposable.Client);
+ }
+
}
}
@@ -310,8 +322,11 @@ public override void Unlock(object key)
return;
using (var disposable = new PooledRedisClientManager.DisposablePooledClient<SerializingRedisClient>(ClientManager))
{
- disposable.Client.Unlock(CacheNamespace.GlobalKey(key, RedisNamespace.NumTagsForLockKey), AcquiredLocks[key]);
- AcquiredLocks.Remove(key);
+ var aLock = new DistributedLock();
+ var globalKey = CacheNamespace.GlobalKey(key, RedisNamespace.NumTagsForLockKey);
+ if (aLock.Unlock(globalKey, AcquiredLocks[key], disposable.Client))
+ AcquiredLocks.Remove(key);
+
}
}
View
6 NHibernate.Caches/Redis/NHibernate.Caches.Redis/NHibernate.Caches.Redis.csproj
@@ -17,7 +17,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>..\..\..\..\..\ReferencedAssemblies\NHibernate\</OutputPath>
+ <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -25,7 +25,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>..\..\..\..\..\ReferencedAssemblies\NHibernate\</OutputPath>
+ <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -33,7 +33,7 @@
<ItemGroup>
<Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\nhibernateTR\nhibernate\lib\net\3.5\Iesi.Collections.dll</HintPath>
+ <HintPath>..\..\Lib\net\3.5\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

No commit comments for this range

Something went wrong with that request. Please try again.