Esempio n. 1
0
        protected LockOptions Clustered_IsLocked(object key, ref object lockId, ref DateTime lockDate, OperationContext operationContext)
        {
            try
            {
                Function func = new Function((int)OpCodes.IsLocked, new object[] { key, lockId, lockDate, operationContext }, false);

                RspList results = Cluster.BroadcastToMultiple(Cluster.Servers,
                                                              func,
                                                              GroupRequest.GET_ALL);

                try
                {
                    ClusterHelper.ValidateResponses(results, typeof(LockOptions), Name);
                }
                catch (LockingException le)
                {
                    //release the lock preemptively...
                    Clustered_UnLock(key, null, true, operationContext);
                    return(null);
                }

                return(ClusterHelper.FindAtomicIsLockedStatusReplicated(results, ref lockId, ref lockDate));
            }
            catch (CacheException e)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new GeneralFailureException(e.Message, e);
            }
        }