Package net.sf.ehcache.transaction

Examples of net.sf.ehcache.transaction.SoftLock.tryLock()


            Object value = element.getObjectValue();
            if (value instanceof SoftLock) {
                SoftLock softLock = (SoftLock) value;
                try {
                    LOG.debug("cache {} key {} soft locked, awaiting unlock...", cache.getName(), key);
                    boolean gotLock = softLock.tryLock(timeLeft);
                    if (gotLock) {
                        softLock.clearTryLock();
                    }
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
View Full Code Here


            Object value = element.getObjectValue();
            if (value instanceof SoftLock) {
                SoftLock softLock = (SoftLock) value;
                try {
                    LOG.debug("cache {} key {} soft locked, awaiting unlock...", cache.getName(), key);
                    boolean gotLock = softLock.tryLock(timeLeft);
                    if (gotLock) {
                        softLock.clearTryLock();
                    }
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
View Full Code Here

                        return false;
                    } else {
                        LOG.debug("put: cache [{}] key [{}] soft locked in foreign transaction, waiting {}ms for soft lock to die...",
                                new Object[] {cacheName, key, timeBeforeTimeout()});
                        try {
                            boolean locked = softLock.tryLock(timeBeforeTimeout());
                            if (!locked) {
                                LOG.debug("put: cache [{}] key [{}] soft locked in foreign transaction and not released before" +
                                        " current transaction timeout", cacheName, key);
                                throw new DeadLockException("deadlock detected in cache [" + cacheName + "] on key [" + key + "]" +
                                        " between current transaction [" + getCurrentTransactionContext().getTransactionId() + "]" +
View Full Code Here

                        return copyElementForRead(removed);
                    } else {
                        try {
                            LOG.debug("remove: cache [{}] key [{}] soft locked in foreign transaction, waiting {}ms for soft lock to" +
                                    " die...", new Object[] {cacheName, key, timeBeforeTimeout()});
                            boolean locked = softLock.tryLock(timeBeforeTimeout());
                            if (!locked) {
                                LOG.debug("remove: cache [{}] key [{}] soft locked in foreign transaction and not released before" +
                                        " current transaction timeout", cacheName, key);
                                throw new DeadLockException("deadlock detected in cache [" + cacheName + "] on key [" + key + "] between" +
                                        " current transaction [" + getCurrentTransactionContext().getTransactionId() + "] and foreign" +
View Full Code Here

                    }
                } else {
                    LOG.debug("putIfAbsent: cache [{}] key [{}] soft locked in foreign transaction, waiting {}ms for soft lock to die...",
                            new Object[] {cacheName, key, timeBeforeTimeout()});
                    try {
                        boolean locked = softLock.tryLock(timeBeforeTimeout());
                        if (!locked) {
                            LOG.debug("putIfAbsent: cache [{}] key [{}] soft locked in foreign transaction and not released before" +
                                    " current transaction timeout", cacheName, key);
                            throw new DeadLockException("deadlock detected in cache [" + cacheName + "] on key [" + key + "] between" +
                                    " current transaction [" + getCurrentTransactionContext().getTransactionId() + "] and foreign" +
View Full Code Here

                        }
                    } else {
                        try {
                            LOG.debug("removeElement: cache [{}] key [{}] soft locked in foreign transaction, waiting {}ms for soft" +
                                    " lock to die...", new Object[] {cacheName, key, timeBeforeTimeout()});
                            boolean locked = softLock.tryLock(timeBeforeTimeout());
                            if (!locked) {
                                LOG.debug("removeElement: cache [{}] key [{}] soft locked in foreign transaction and not released" +
                                        " before current transaction timeout", cacheName, key);
                                throw new DeadLockException("deadlock detected in cache [" + cacheName + "] on key [" + key + "] between" +
                                        " current transaction [" + getCurrentTransactionContext().getTransactionId() + "] and foreign" +
View Full Code Here

                        }
                    } else {
                        try {
                            LOG.debug("replace: cache [{}] key [{}] soft locked in foreign transaction, waiting {}ms for" +
                                    " soft lock to die...", new Object[] {cacheName, key, timeBeforeTimeout()});
                            boolean locked = softLock.tryLock(timeBeforeTimeout());
                            if (!locked) {
                                LOG.debug("replace: cache [{}] key [{}] soft locked in foreign transaction and not released before" +
                                        " current transaction timeout", cacheName, key);
                                throw new DeadLockException("deadlock detected in cache [" + cacheName + "] on key [" + key + "]" +
                                        " between current transaction [" + getCurrentTransactionContext().getTransactionId() + "]" +
View Full Code Here

                        }
                    } else {
                        try {
                            LOG.debug("replace: cache [{}] key [{}] soft locked in foreign transaction, waiting {}ms for soft lock" +
                                    " to die...", new Object[] {cacheName, key, timeBeforeTimeout()});
                            boolean locked = softLock.tryLock(timeBeforeTimeout());
                            if (!locked) {
                                LOG.debug("replace: cache [{}] key [{}] soft locked in foreign transaction and not released before" +
                                        " current transaction timeout", cacheName, key);
                                throw new DeadLockException("deadlock detected in cache [" + cacheName + "] on key [" + key + "]" +
                                        " between current transaction [" + getCurrentTransactionContext().getTransactionId() + "]" +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.