Hello,
I'm using .NET 4.7.2, soss_svcdotnet 5.0.0.0, and soss_namedchache 6.0.0.0. Per documentation, calling AcquireLock(string) "
on an instance of the NamedCache that already has a lock on the cached object will reset the 90 second lock timeout." However, when I use the same NamedCache instance in a new thread, I get "Soss.Client.ObjectLockedException: 'Unable to acquire lock while retrieving object. Object Key: TEST'". This exception is thrown when the object is locked by another "client". How is the same instance of NamedCache considered a different client?
See sample code below
I'm using .NET 4.7.2, soss_svcdotnet 5.0.0.0, and soss_namedchache 6.0.0.0. Per documentation, calling AcquireLock(string) "
on an instance of the NamedCache that already has a lock on the cached object will reset the 90 second lock timeout." However, when I use the same NamedCache instance in a new thread, I get "Soss.Client.ObjectLockedException: 'Unable to acquire lock while retrieving object. Object Key: TEST'". This exception is thrown when the object is locked by another "client". How is the same instance of NamedCache considered a different client?
See sample code below
C#:
const string TEST_KEY = "TEST";
var nc = CacheFactory.GetCache("Scenario2");
nc.Clear();
nc.MaxLockAttempts = 1;
nc.Insert(TEST_KEY, "blah", new CreatePolicy(), false, false);
nc.AcquireLock(TEST_KEY);
new Thread(() =>
{
nc.AcquireLock(TEST_KEY);
}).Start();