Example usage for org.springframework.data.gemfire GemfireCacheUtils convertQueryExceptions

List of usage examples for org.springframework.data.gemfire GemfireCacheUtils convertQueryExceptions

Introduction

In this page you can find the example usage for org.springframework.data.gemfire GemfireCacheUtils convertQueryExceptions.

Prototype

static DataAccessException convertQueryExceptions(RuntimeException cause) 

Source Link

Document

Dedicated method for converting exceptions changed in 6.5 that had their parent changed.

Usage

From source file:org.springframework.data.gemfire.CacheFactoryBean.java

public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
    if (ex instanceof GemFireException) {
        return GemfireCacheUtils.convertGemfireAccessException((GemFireException) ex);
    }//from ww  w  .ja v  a 2s .c om
    if (ex instanceof IllegalArgumentException) {
        DataAccessException wrapped = GemfireCacheUtils.convertQueryExceptions(ex);
        // ignore conversion if the generic exception is returned
        if (!(wrapped instanceof GemfireSystemException)) {
            return wrapped;
        }
    }

    return null;
}

From source file:org.springframework.data.gemfire.GemfireAccessor.java

/**
 * Converts the given GemFire exception to an appropriate exception from the
 * <code>org.springframework.dao</code> hierarchy. Note that this particular implementation
 * is called only for GemFire querying exception that do <b>NOT</b> extend from GemFire exception.
 * May be overridden in subclasses.//from   w  w w.  j a  v  a  2 s .c om
 * 
 * @see com.gemstone.gemfire.cache.query.CqInvalidException
 * @param ex GemFireException that occurred
 * @return the corresponding DataAccessException instance
 */
public DataAccessException convertGemFireQueryException(RuntimeException ex) {
    return GemfireCacheUtils.convertQueryExceptions(ex);
}