Search in sources :

Example 1 with RemotePutResponse

use of org.apache.geode.internal.cache.RemotePutMessage.RemotePutResponse in project geode by apache.

the class DistributedTXRegionStub method putEntry.

public boolean putEntry(EntryEventImpl event, boolean ifNew, boolean ifOld, Object expectedOldValue, boolean requireOldValue, long lastModified, boolean overwriteDestroyed) {
    boolean retVal = false;
    final LocalRegion r = event.getLocalRegion();
    try {
        RemotePutResponse response = RemotePutMessage.txSend(state.getTarget(), r, event, lastModified, ifNew, ifOld, expectedOldValue, requireOldValue);
        PutResult result = response.waitForResult();
        event.setOldValue(result.oldValue, true);
        retVal = result.returnValue;
    } catch (TransactionDataNotColocatedException enfe) {
        throw enfe;
    } catch (CacheException ce) {
        throw new PartitionedRegionException(LocalizedStrings.PartitionedRegion_DESTROY_OF_ENTRY_ON_0_FAILED.toLocalizedString(state.getTarget()), ce);
    } catch (RegionDestroyedException rde) {
        throw new TransactionDataNotColocatedException(LocalizedStrings.RemoteMessage_REGION_0_NOT_COLOCATED_WITH_TRANSACTION.toLocalizedString(rde.getRegionFullPath()), rde);
    } catch (RemoteOperationException roe) {
        throw new TransactionDataNodeHasDepartedException(roe);
    }
    return retVal;
}
Also used : PartitionedRegionException(org.apache.geode.internal.cache.PartitionedRegionException) CacheException(org.apache.geode.cache.CacheException) TransactionDataNotColocatedException(org.apache.geode.cache.TransactionDataNotColocatedException) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) RemoteOperationException(org.apache.geode.internal.cache.RemoteOperationException) RemotePutResponse(org.apache.geode.internal.cache.RemotePutMessage.RemotePutResponse) LocalRegion(org.apache.geode.internal.cache.LocalRegion) PutResult(org.apache.geode.internal.cache.RemotePutMessage.PutResult) TransactionDataNodeHasDepartedException(org.apache.geode.cache.TransactionDataNodeHasDepartedException)

Aggregations

CacheException (org.apache.geode.cache.CacheException)1 RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)1 TransactionDataNodeHasDepartedException (org.apache.geode.cache.TransactionDataNodeHasDepartedException)1 TransactionDataNotColocatedException (org.apache.geode.cache.TransactionDataNotColocatedException)1 LocalRegion (org.apache.geode.internal.cache.LocalRegion)1 PartitionedRegionException (org.apache.geode.internal.cache.PartitionedRegionException)1 RemoteOperationException (org.apache.geode.internal.cache.RemoteOperationException)1 PutResult (org.apache.geode.internal.cache.RemotePutMessage.PutResult)1 RemotePutResponse (org.apache.geode.internal.cache.RemotePutMessage.RemotePutResponse)1