Description
To reproduce: create two caches with WriteThrough=true and some CacheStore (implementation can be empty).
Attempt to update both caches within a transaction:
using (var tx = ignite.GetTransactions().TxStart())
{
cache1.Put(1, 1);
cache2.Put(1, 1);
tx.Commit();
}
Exception occurs:
(err) Failed to notify listener: o.a.i.i.processors.cache.distributed.near.GridNearTxLocal$16@17695df3javax.cache.integration.CacheWriterException: PlatformNativeException [cause=System.InvalidOperationException [idHash=1909546776, hash=1265661973, ClassName=System.InvalidOperationException, Data=null, ExceptionMethod=8 Get Apache.Ignite.Core, Version=2.1.0.19388, Culture=neutral, PublicKeyToken=a487a7ff0b2aaa4a Apache.Ignite.Core.Impl.Handle.HandleRegistry T Get[T](Int64, Boolean), HelpURL=null, HResult=-2146233079, InnerException=null, Message=Resource handle has been released (is Ignite stopping?)., RemoteStackIndex=0, RemoteStackTraceString=null, Source=Apache.Ignite.Core, StackTraceString= at Apache.Ignite.Core.Impl.Handle.HandleRegistry.Get[T](Int64 id, Boolean throwOnAbsent) in C:\w\incubator-ignite\modules\platforms\dotnet\Apache.Ignite.Core\Impl\Handle\HandleRegistry.cs:line 262 at Apache.Ignite.Core.Impl.Cache.Store.CacheStoreInternal`2.Invoke(IBinaryStream stream, Ignite grid) in C:\w\incubator-ignite\modules\platforms\dotnet\Apache.Ignite.Core\Impl\Cache\Store\CacheStoreInternal.cs:line 112 at Apache.Ignite.Core.Impl.Cache.Store.CacheStore.Invoke(PlatformMemoryStream stream, Ignite grid) in C:\w\incubator-ignite\modules\platforms\dotnet\Apache.Ignite.Core\Impl\Cache\Store\CacheStore.cs:line 127 at Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.CacheStoreInvoke(Int64 memPtr) in C:\w\incubator-ignite\modules\platforms\dotnet\Apache.Ignite.Core\Impl\Unmanaged\UnmanagedCallbacks.cs:line 366
Explanation:
- Cache stores share same session within a transaction
- Session in Java is uses to store .NET session handle, so both stores have the same .NET session (which is good: consistent with Java)
- Each store calls sessionEnd, so session gets released multiple times - this causes HandleRegistry exception
Current unit test uses Spring XML with shared PlatformDotNetCacheStoreFactory, which caches created store instance for some reason, so the bug is hidden, since both caches use the same store instance.
Attachments
Issue Links
- links to