Search in sources :

Example 6 with AllConnectionsInUseException

use of org.apache.geode.cache.client.AllConnectionsInUseException in project geode by apache.

the class SingleHopOperationCallable method call.

public Object call() throws Exception {
    op.initMessagePart();
    Object result = null;
    boolean onlyUseExistingCnx = ((pool.getMaxConnections() != -1 && pool.getConnectionCount() >= pool.getMaxConnections()) ? true : false);
    op.setAllowDuplicateMetadataRefresh(!onlyUseExistingCnx);
    try {
        UserAttributes.userAttributes.set(securityAttributes);
        result = this.pool.executeOn(server, op, true, onlyUseExistingCnx);
    } catch (AllConnectionsInUseException ex) {
        // server
        if (op instanceof ExecuteRegionFunctionSingleHopOpImpl) {
            ExecuteRegionFunctionSingleHopOpImpl newop = (ExecuteRegionFunctionSingleHopOpImpl) op;
            result = this.pool.execute(new ExecuteRegionFunctionOpImpl(newop));
        } else {
            result = this.pool.execute(this.op);
        }
    } finally {
        UserAttributes.userAttributes.set(null);
    }
    return result;
}
Also used : ExecuteRegionFunctionOpImpl(org.apache.geode.cache.client.internal.ExecuteRegionFunctionOp.ExecuteRegionFunctionOpImpl) AllConnectionsInUseException(org.apache.geode.cache.client.AllConnectionsInUseException) ExecuteRegionFunctionSingleHopOpImpl(org.apache.geode.cache.client.internal.ExecuteRegionFunctionSingleHopOp.ExecuteRegionFunctionSingleHopOpImpl)

Aggregations

AllConnectionsInUseException (org.apache.geode.cache.client.AllConnectionsInUseException)6 ServerLocation (org.apache.geode.distributed.internal.ServerLocation)5 ServerConnectivityException (org.apache.geode.cache.client.ServerConnectivityException)3 ServerOperationException (org.apache.geode.cache.client.ServerOperationException)3 ClientServerTest (org.apache.geode.test.junit.categories.ClientServerTest)2 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)2 Test (org.junit.Test)2 CacheLoaderException (org.apache.geode.cache.CacheLoaderException)1 ExecuteRegionFunctionOpImpl (org.apache.geode.cache.client.internal.ExecuteRegionFunctionOp.ExecuteRegionFunctionOpImpl)1 ExecuteRegionFunctionSingleHopOpImpl (org.apache.geode.cache.client.internal.ExecuteRegionFunctionSingleHopOp.ExecuteRegionFunctionSingleHopOpImpl)1