Package org.hibernate.cache

Examples of org.hibernate.cache.CacheException


        try {
            if (transactionManager != null) {
                tx = transactionManager.suspend();
            }
        } catch (SystemException se) {
            throw new CacheException("Could not suspend transaction", se);
        }
        return tx;
    }
View Full Code Here


    public void resume(Transaction tx) {
        try {
            if (tx != null)
                transactionManager.resume(tx);
        } catch (Exception e) {
            throw new CacheException("Could not resume transaction", e);
        }
    }
View Full Code Here

            Option opt = getNonLockingDataVersionOption(false);
            // We ensure ASYNC semantics (JBCACHE-1175)
            opt.setForceAsynchronous(true);
            CacheHelper.put(getCacheInstance(), getRegionFqn(), key, value, opt);
        } catch (Exception e) {
            throw new CacheException(e);
        } finally {
            resume(tx);
        }
    }
View Full Code Here

            return optimistic ? new OptimisticTransactionalAccess(this) : new TransactionalAccess(this);
        }

        // todo : add support for READ_WRITE ( + NONSTRICT_READ_WRITE ??? )

        throw new CacheException("unsupported access type [" + accessType.getName() + "]");
    }
View Full Code Here

     */
    public static Object get(Cache cache, Fqn region, Object key) throws CacheException {
        try {
            return cache.get(new Fqn(region, key), ITEM);
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

        catch (TimeoutException ignored) {
            // ignore it
            return null;
        }
        catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

    public static void put(Cache cache, Fqn region, Object key, Object value, Option option) throws CacheException {
        try {
            setInvocationOption(cache, option);
            cache.put(new Fqn(region, key), ITEM, value);
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

        }
        catch (TimeoutException allowed) {
            // ignore it
        }
        catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

        } catch (TimeoutException te) {
            // ignore!
            log.debug("ignoring write lock acquisition failure");
            return false;
        } catch (Throwable t) {
            throw new CacheException(t);
        }
    }
View Full Code Here

    public static void remove(Cache cache, Fqn region, Object key, Option option) throws CacheException {
        try {
            setInvocationOption(cache, option);
            cache.removeNode(new Fqn(region, key));
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.CacheException

Copyright © 2018 www.massapicom. 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.