use of org.apache.geode.InvalidDeltaException in project geode by apache.
the class EntryEventImpl method processDeltaBytes.
private void processDeltaBytes(Object oldValueInVM) {
if (!this.region.hasSeenEvent(this)) {
if (oldValueInVM == null || Token.isInvalidOrRemoved(oldValueInVM)) {
this.region.getCachePerfStats().incDeltaFailedUpdates();
throw new InvalidDeltaException("Old value not found for key " + this.keyInfo.getKey());
}
FilterProfile fp = this.region.getFilterProfile();
// If compression is enabled then we've already gotten a new copy due to the
// serializaion and deserialization that occurs.
boolean copy = this.region.getCompressor() == null && (this.region.isCopyOnRead() || this.region.getCloningEnabled() || (fp != null && fp.getCqCount() > 0));
Object value = oldValueInVM;
boolean wasCD = false;
if (value instanceof CachedDeserializable) {
wasCD = true;
if (copy) {
value = ((CachedDeserializable) value).getDeserializedWritableCopy(this.region, re);
} else {
value = ((CachedDeserializable) value).getDeserializedValue(this.region, re);
}
} else {
if (copy) {
value = CopyHelper.copy(value);
}
}
boolean deltaBytesApplied = false;
try {
long start = CachePerfStats.getStatTime();
((org.apache.geode.Delta) value).fromDelta(new DataInputStream(new ByteArrayInputStream(getDeltaBytes())));
this.region.getCachePerfStats().endDeltaUpdate(start);
deltaBytesApplied = true;
} catch (RuntimeException rte) {
throw rte;
} catch (VirtualMachineError e) {
SystemFailure.initiateFailure(e);
throw e;
} catch (Throwable t) {
SystemFailure.checkFailure();
throw new DeltaSerializationException("Exception while deserializing delta bytes.", t);
} finally {
if (!deltaBytesApplied) {
this.region.getCachePerfStats().incDeltaFailedUpdates();
}
}
if (logger.isDebugEnabled()) {
logger.debug("Delta has been applied for key {}", getKey());
}
// assert event.getNewValue() == null;
if (wasCD) {
CachedDeserializable old = (CachedDeserializable) oldValueInVM;
int valueSize;
if (GemFireCacheImpl.DELTAS_RECALCULATE_SIZE) {
valueSize = CachedDeserializableFactory.calcMemSize(value, region.getObjectSizer(), false);
} else {
valueSize = old.getValueSizeInBytes();
}
value = CachedDeserializableFactory.create(value, valueSize);
}
setNewValue(value);
if (this.causedByMessage != null && this.causedByMessage instanceof PutMessage) {
((PutMessage) this.causedByMessage).setDeltaValObj(value);
}
} else {
this.region.getCachePerfStats().incDeltaFailedUpdates();
throw new InvalidDeltaException("Cache encountered replay of event containing delta bytes for key " + this.keyInfo.getKey());
}
}
use of org.apache.geode.InvalidDeltaException in project geode by apache.
the class PutMessage method operateOnPartitionedRegion.
/**
* This method is called upon receipt and make the desired changes to the PartitionedRegion Note:
* It is very important that this message does NOT cause any deadlocks as the sender will wait
* indefinitely for the acknowledgement
*/
@Override
protected boolean operateOnPartitionedRegion(DistributionManager dm, PartitionedRegion r, long startTime) throws EntryExistsException, DataLocationException, IOException {
// set the internal DS. Required to
this.setInternalDs(r.getSystem());
// checked DS level delta-enabled property
// while sending delta
PartitionedRegionDataStore ds = r.getDataStore();
boolean sendReply = true;
InternalDistributedMember eventSender = originalSender;
if (eventSender == null) {
eventSender = getSender();
}
@Released final EntryEventImpl ev = EntryEventImpl.create(r, getOperation(), getKey(), null, /* newValue */
getCallbackArg(), false, /* originRemote - false to force distribution in buckets */
eventSender, true, /* generateCallbacks */
false);
try {
if (this.versionTag != null) {
this.versionTag.replaceNullIDs(getSender());
ev.setVersionTag(this.versionTag);
}
if (this.bridgeContext != null) {
ev.setContext(this.bridgeContext);
}
Assert.assertTrue(eventId != null);
ev.setEventId(eventId);
ev.setCausedByMessage(this);
ev.setInvokePRCallbacks(!notificationOnly);
ev.setPossibleDuplicate(this.posDup);
/*
* if (this.hasOldValue) { if (this.oldValueIsSerialized) {
* ev.setSerializedOldValue(getOldValueBytes()); } else { ev.setOldValue(getOldValueBytes());
* } }
*/
ev.setDeltaBytes(this.deltaBytes);
if (this.hasDelta) {
this.valObj = null;
// New value will be set once it is generated with fromDelta() inside
// EntryEventImpl.processDeltaBytes()
ev.setNewValue(this.valObj);
} else {
switch(this.deserializationPolicy) {
case DistributedCacheOperation.DESERIALIZATION_POLICY_LAZY:
ev.setSerializedNewValue(getValBytes());
break;
case DistributedCacheOperation.DESERIALIZATION_POLICY_NONE:
ev.setNewValue(getValBytes());
break;
default:
throw new AssertionError("unknown deserialization policy: " + deserializationPolicy);
}
}
if (!notificationOnly) {
if (ds == null) {
throw new AssertionError("This process should have storage" + " for this operation: " + this.toString());
}
try {
// the event must show it's true origin for cachewriter invocation
// event.setOriginRemote(true);
// this.op = r.doCacheWriteBeforePut(event, ifNew); // TODO fix this for bug 37072
ev.setOriginRemote(false);
result = r.getDataView().putEntryOnRemote(ev, this.ifNew, this.ifOld, this.expectedOldValue, this.requireOldValue, this.lastModified, true);
if (!this.result) {
// make sure the region hasn't gone away
r.checkReadiness();
// sbawaska: I cannot see how ifOld and ifNew can both be false, hence removing
// if (!this.ifNew && !this.ifOld) {
// // no reason to be throwing an exception, so let's retry
// ForceReattemptException fre = new ForceReattemptException(
// LocalizedStrings.PutMessage_UNABLE_TO_PERFORM_PUT_BUT_OPERATION_SHOULD_NOT_FAIL_0.toLocalizedString());
// fre.setHash(key.hashCode());
// sendReply(getSender(), getProcessorId(), dm,
// new ReplyException(fre), r, startTime);
// sendReply = false;
// }
}
} catch (CacheWriterException cwe) {
sendReply(getSender(), getProcessorId(), dm, new ReplyException(cwe), r, startTime);
return false;
} catch (PrimaryBucketException pbe) {
sendReply(getSender(), getProcessorId(), dm, new ReplyException(pbe), r, startTime);
return false;
} catch (InvalidDeltaException ide) {
sendReply(getSender(), getProcessorId(), dm, new ReplyException(ide), r, startTime);
r.getCachePerfStats().incDeltaFullValuesRequested();
return false;
}
if (logger.isTraceEnabled(LogMarker.DM)) {
logger.trace(LogMarker.DM, "PutMessage {} with key: {} val: {}", (result ? "updated bucket" : "did not update bucket"), getKey(), (getValBytes() == null ? "null" : "(" + getValBytes().length + " bytes)"));
}
} else {
// notificationOnly
@Released EntryEventImpl e2 = createListenerEvent(ev, r, dm.getDistributionManagerId());
final EnumListenerEvent le;
try {
if (e2.getOperation().isCreate()) {
le = EnumListenerEvent.AFTER_CREATE;
} else {
le = EnumListenerEvent.AFTER_UPDATE;
}
r.invokePutCallbacks(le, e2, r.isInitialized(), true);
} finally {
// if e2 == ev then no need to free it here. The outer finally block will get it.
if (e2 != ev) {
e2.release();
}
}
result = true;
}
// set operation for reply message
setOperation(ev.getOperation());
if (sendReply) {
sendReply(getSender(), getProcessorId(), dm, null, r, startTime, ev);
}
return false;
} finally {
ev.release();
}
}
use of org.apache.geode.InvalidDeltaException in project geode by apache.
the class Put61 method cmdExecute.
@Override
public void cmdExecute(Message clientMessage, ServerConnection serverConnection, long p_start) throws IOException, InterruptedException {
long start = p_start;
Part regionNamePart = null, keyPart = null, valuePart = null, callbackArgPart = null;
String regionName = null;
Object callbackArg = null, key = null;
Part eventPart = null;
StringBuffer errMessage = new StringBuffer();
boolean isDelta = false;
CachedRegionHelper crHelper = serverConnection.getCachedRegionHelper();
CacheServerStats stats = serverConnection.getCacheServerStats();
// requiresResponse = true;
serverConnection.setAsTrue(REQUIRES_RESPONSE);
{
long oldStart = start;
start = DistributionStats.getStatTime();
stats.incReadPutRequestTime(start - oldStart);
}
// Retrieve the data from the message parts
regionNamePart = clientMessage.getPart(0);
keyPart = clientMessage.getPart(1);
try {
isDelta = (Boolean) clientMessage.getPart(2).getObject();
} catch (Exception e) {
writeException(clientMessage, MessageType.PUT_DELTA_ERROR, e, false, serverConnection);
serverConnection.setAsTrue(RESPONDED);
// CachePerfStats not available here.
return;
}
valuePart = clientMessage.getPart(3);
eventPart = clientMessage.getPart(4);
if (clientMessage.getNumberOfParts() > 5) {
callbackArgPart = clientMessage.getPart(5);
try {
callbackArg = callbackArgPart.getObject();
} catch (Exception e) {
writeException(clientMessage, e, false, serverConnection);
serverConnection.setAsTrue(RESPONDED);
return;
}
}
regionName = regionNamePart.getString();
try {
key = keyPart.getStringOrObject();
} catch (Exception e) {
writeException(clientMessage, e, false, serverConnection);
serverConnection.setAsTrue(RESPONDED);
return;
}
final boolean isDebugEnabled = logger.isDebugEnabled();
if (isDebugEnabled) {
logger.debug("{}: Received 6.1{}put request ({} bytes) from {} for region {} key {}", serverConnection.getName(), (isDelta ? " delta " : " "), clientMessage.getPayloadLength(), serverConnection.getSocketString(), regionName, key);
}
// Process the put request
if (key == null || regionName == null) {
if (key == null) {
String putMsg = " The input key for the 6.1 put request is null";
if (isDebugEnabled) {
logger.debug("{}:{}", serverConnection.getName(), putMsg);
}
errMessage.append(putMsg);
}
if (regionName == null) {
String putMsg = " The input region name for the 6.1 put request is null";
if (isDebugEnabled) {
logger.debug("{}:{}", serverConnection.getName(), putMsg);
}
errMessage.append(putMsg);
}
writeErrorResponse(clientMessage, MessageType.PUT_DATA_ERROR, errMessage.toString(), serverConnection);
serverConnection.setAsTrue(RESPONDED);
return;
}
LocalRegion region = (LocalRegion) serverConnection.getCache().getRegion(regionName);
if (region == null) {
String reason = " was not found during 6.1 put request";
writeRegionDestroyedEx(clientMessage, regionName, reason, serverConnection);
serverConnection.setAsTrue(RESPONDED);
return;
}
if (valuePart.isNull() && region.containsKey(key)) {
// Invalid to 'put' a null value in an existing key
String putMsg = " Attempted to 6.1 put a null value for existing key " + key;
if (isDebugEnabled) {
logger.debug("{}:{}", serverConnection.getName(), putMsg);
}
errMessage.append(putMsg);
writeErrorResponse(clientMessage, MessageType.PUT_DATA_ERROR, errMessage.toString(), serverConnection);
serverConnection.setAsTrue(RESPONDED);
return;
}
// try {
// this.eventId = (EventID)eventPart.getObject();
ByteBuffer eventIdPartsBuffer = ByteBuffer.wrap(eventPart.getSerializedForm());
long threadId = EventID.readEventIdPartsFromOptmizedByteArray(eventIdPartsBuffer);
long sequenceId = EventID.readEventIdPartsFromOptmizedByteArray(eventIdPartsBuffer);
EventID eventId = new EventID(serverConnection.getEventMemberIDByteArray(), threadId, sequenceId);
try {
Object value = null;
if (!isDelta) {
value = valuePart.getSerializedForm();
}
boolean isObject = valuePart.isObject();
boolean isMetaRegion = region.isUsedForMetaRegion();
clientMessage.setMetaRegion(isMetaRegion);
this.securityService.authorizeRegionWrite(regionName, key.toString());
AuthorizeRequest authzRequest = null;
if (!isMetaRegion) {
authzRequest = serverConnection.getAuthzRequest();
}
if (authzRequest != null) {
if (DynamicRegionFactory.regionIsDynamicRegionList(regionName)) {
authzRequest.createRegionAuthorize((String) key);
} else // Allow PUT operations on meta regions (bug #38961)
{
PutOperationContext putContext = authzRequest.putAuthorize(regionName, key, value, isObject, callbackArg);
value = putContext.getValue();
isObject = putContext.isObject();
callbackArg = putContext.getCallbackArg();
}
}
// If the value is 1 byte and the byte represents null,
// attempt to create the entry. This test needs to be
// moved to DataSerializer or DataSerializer.NULL needs
// to be publicly accessible.
boolean result = false;
if (value == null && !isDelta) {
// Create the null entry. Since the value is null, the value of the
// isObject
// the true after null doesn't matter and is not used.
result = region.basicBridgeCreate(key, null, true, callbackArg, serverConnection.getProxyID(), true, new EventIDHolder(eventId), false);
} else {
// Put the entry
byte[] delta = null;
if (isDelta) {
delta = valuePart.getSerializedForm();
}
result = region.basicBridgePut(key, value, delta, isObject, callbackArg, serverConnection.getProxyID(), true, new EventIDHolder(eventId));
}
if (result) {
serverConnection.setModificationInfo(true, regionName, key);
} else {
String message = serverConnection.getName() + ": Failed to 6.1 put entry for region " + regionName + " key " + key + " value " + valuePart;
if (isDebugEnabled) {
logger.debug(message);
}
throw new Exception(message);
}
} catch (RegionDestroyedException rde) {
writeException(clientMessage, rde, false, serverConnection);
serverConnection.setAsTrue(RESPONDED);
return;
} catch (ResourceException re) {
writeException(clientMessage, re, false, serverConnection);
serverConnection.setAsTrue(RESPONDED);
return;
} catch (InvalidDeltaException ide) {
logger.info(LocalizedMessage.create(LocalizedStrings.UpdateOperation_ERROR_APPLYING_DELTA_FOR_KEY_0_OF_REGION_1, new Object[] { key, regionName }));
writeException(clientMessage, MessageType.PUT_DELTA_ERROR, ide, false, serverConnection);
serverConnection.setAsTrue(RESPONDED);
region.getCachePerfStats().incDeltaFullValuesRequested();
return;
} catch (Exception ce) {
// If an interrupted exception is thrown , rethrow it
checkForInterrupt(serverConnection, ce);
// If an exception occurs during the put, preserve the connection
writeException(clientMessage, ce, false, serverConnection);
serverConnection.setAsTrue(RESPONDED);
if (ce instanceof GemFireSecurityException) {
// logged by the security logger
if (isDebugEnabled) {
logger.debug("{}: Unexpected Security exception", serverConnection.getName(), ce);
}
} else if (isDebugEnabled) {
logger.debug("{}: Unexpected Exception", serverConnection.getName(), ce);
}
return;
} finally {
long oldStart = start;
start = DistributionStats.getStatTime();
stats.incProcessPutTime(start - oldStart);
}
// Increment statistics and write the reply
if (region instanceof PartitionedRegion) {
PartitionedRegion pr = (PartitionedRegion) region;
if (pr.getNetworkHopType() != PartitionedRegion.NETWORK_HOP_NONE) {
writeReplyWithRefreshMetadata(clientMessage, serverConnection, pr, pr.getNetworkHopType());
pr.clearNetworkHopData();
} else {
writeReply(clientMessage, serverConnection);
}
} else {
writeReply(clientMessage, serverConnection);
}
serverConnection.setAsTrue(RESPONDED);
if (isDebugEnabled) {
logger.debug("{}: Sent 6.1 put response back to {} for region {} key {} value {}", serverConnection.getName(), serverConnection.getSocketString(), regionName, key, valuePart);
}
stats.incWritePutResponseTime(DistributionStats.getStatTime() - start);
}
use of org.apache.geode.InvalidDeltaException in project geode by apache.
the class CacheClientUpdater method handleUpdate.
/**
* Create or update an entry
*
* @param clientMessage message containing the data
*/
private void handleUpdate(Message clientMessage) {
String regionName = null;
Object key = null;
Part valuePart = null;
final boolean isDebugEnabled = logger.isDebugEnabled();
try {
this.isOpCompleted = false;
// Retrieve the data from the put message parts
if (isDebugEnabled) {
logger.debug("Received put message of length ({} bytes)", clientMessage.getPayloadLength());
}
int partCnt = 0;
Part regionNamePart = clientMessage.getPart(partCnt++);
Part keyPart = clientMessage.getPart(partCnt++);
boolean isDeltaSent = (Boolean) clientMessage.getPart(partCnt++).getObject();
valuePart = clientMessage.getPart(partCnt++);
Part callbackArgumentPart = clientMessage.getPart(partCnt++);
VersionTag versionTag = (VersionTag) clientMessage.getPart(partCnt++).getObject();
if (versionTag != null) {
versionTag.replaceNullIDs((InternalDistributedMember) this.endpoint.getMemberId());
}
Part isInterestListPassedPart = clientMessage.getPart(partCnt++);
Part hasCqsPart = clientMessage.getPart(partCnt++);
EventID eventId = (EventID) clientMessage.getPart(clientMessage.getNumberOfParts() - 1).getObject();
boolean withInterest = (Boolean) isInterestListPassedPart.getObject();
boolean withCQs = (Boolean) hasCqsPart.getObject();
regionName = regionNamePart.getString();
key = keyPart.getStringOrObject();
Object callbackArgument = callbackArgumentPart.getObject();
// Don't automatically deserialize the value.
// Pass it onto the region as a byte[]. If it is a serialized
// object, it will be stored as a CachedDeserializable and
// deserialized only when requested.
boolean isCreate = clientMessage.getMessageType() == MessageType.LOCAL_CREATE;
if (isDebugEnabled) {
logger.debug("Putting entry for region: {} key: {} create: {}{} callbackArgument: {} withInterest={} withCQs={} eventID={} version={}", regionName, key, isCreate, valuePart.isObject() ? new StringBuilder(" value: ").append(deserialize(valuePart.getSerializedForm())) : "", callbackArgument, withInterest, withCQs, eventId, versionTag);
}
LocalRegion region = (LocalRegion) this.cacheHelper.getRegion(regionName);
Object newValue = null;
byte[] deltaBytes = null;
Object fullValue = null;
boolean isValueObject;
if (!isDeltaSent) {
// bug #42162 - must check for a serialized null here
byte[] serializedForm = valuePart.getSerializedForm();
if (isCreate && InternalDataSerializer.isSerializedNull(serializedForm)) {
// newValue = null; newValue is already null
} else {
newValue = valuePart.getSerializedForm();
}
if (withCQs) {
fullValue = valuePart.getObject();
}
isValueObject = valuePart.isObject();
} else {
deltaBytes = valuePart.getSerializedForm();
isValueObject = true;
}
if (region == null) {
if (isDebugEnabled && !quitting()) {
logger.debug("{}: Region named {} does not exist", this, regionName);
}
} else if (region.hasServerProxy() && ServerResponseMatrix.checkForValidStateAfterNotification(region, key, clientMessage.getMessageType()) && (withInterest || !withCQs)) {
@Released EntryEventImpl newEvent = null;
try {
// Create an event and put the entry
newEvent = EntryEventImpl.create(region, clientMessage.getMessageType() == MessageType.LOCAL_CREATE ? Operation.CREATE : Operation.UPDATE, key, null, /* newValue */
callbackArgument, /* callbackArg */
true, /* originRemote */
eventId.getDistributedMember());
newEvent.setVersionTag(versionTag);
newEvent.setFromServer(true);
region.basicBridgeClientUpdate(eventId.getDistributedMember(), key, newValue, deltaBytes, isValueObject, callbackArgument, clientMessage.getMessageType() == MessageType.LOCAL_CREATE, this.qManager.getState().getProcessedMarker() || !this.isDurableClient, newEvent, eventId);
this.isOpCompleted = true;
// flag
if (withCQs && isDeltaSent) {
fullValue = newEvent.getNewValue();
}
} catch (InvalidDeltaException ignore) {
Part fullValuePart = requestFullValue(eventId, "Caught InvalidDeltaException.");
region.getCachePerfStats().incDeltaFullValuesRequested();
// TODO: fix this line
fullValue = newValue = fullValuePart.getObject();
isValueObject = fullValuePart.isObject();
region.basicBridgeClientUpdate(eventId.getDistributedMember(), key, newValue, null, isValueObject, callbackArgument, clientMessage.getMessageType() == MessageType.LOCAL_CREATE, this.qManager.getState().getProcessedMarker() || !this.isDurableClient, newEvent, eventId);
this.isOpCompleted = true;
} finally {
if (newEvent != null)
newEvent.release();
}
if (isDebugEnabled) {
logger.debug("Put entry for region: {} key: {} callbackArgument: {}", regionName, key, callbackArgument);
}
}
// Update CQs. CQs can exist without client region.
if (withCQs) {
Part numCqsPart = clientMessage.getPart(partCnt++);
if (isDebugEnabled) {
logger.debug("Received message has CQ Event. Number of cqs interested in the event : {}", numCqsPart.getInt() / 2);
}
partCnt = processCqs(clientMessage, partCnt, numCqsPart.getInt(), clientMessage.getMessageType(), key, fullValue, deltaBytes, eventId);
this.isOpCompleted = true;
}
} catch (Exception e) {
String message = LocalizedStrings.CacheClientUpdater_THE_FOLLOWING_EXCEPTION_OCCURRED_WHILE_ATTEMPTING_TO_PUT_ENTRY_REGION_0_KEY_1_VALUE_2.toLocalizedString(regionName, key, deserialize(valuePart.getSerializedForm()));
handleException(message, e);
}
}
use of org.apache.geode.InvalidDeltaException in project geode by apache.
the class CqServiceImpl method invokeListeners.
private void invokeListeners(String cqName, ClientCQImpl cQuery, CqEventImpl cqEvent, Object[] fullValue) {
if (!cQuery.isRunning() || cQuery.getCqAttributes() == null) {
return;
}
// invoke CQ Listeners.
CqListener[] cqListeners = cQuery.getCqAttributes().getCqListeners();
final boolean isDebugEnabled = logger.isDebugEnabled();
if (isDebugEnabled) {
logger.debug("Invoking CQ listeners for {}, number of listeners : {} cqEvent : {}", cqName, cqListeners.length, cqEvent);
}
for (int lCnt = 0; lCnt < cqListeners.length; lCnt++) {
try {
// by the CqAttributeMutator.
if (cqListeners[lCnt] != null) {
cQuery.getVsdStats().incNumCqListenerInvocations();
try {
if (cqEvent.getThrowable() != null) {
cqListeners[lCnt].onError(cqEvent);
} else {
cqListeners[lCnt].onEvent(cqEvent);
}
} catch (InvalidDeltaException ide) {
if (isDebugEnabled) {
logger.debug("CqService.dispatchCqListeners(): Requesting full value...");
}
Part result = (Part) GetEventValueOp.executeOnPrimary(cqEvent.getQueueManager().getPool(), cqEvent.getEventID(), null);
Object newVal = result.getObject();
if (result == null || newVal == null) {
if (!cache.getCancelCriterion().isCancelInProgress()) {
Exception ex = new Exception("Failed to retrieve full value from server for eventID " + cqEvent.getEventID());
logger.warn(LocalizedMessage.create(LocalizedStrings.CqService_EXCEPTION_IN_THE_CQLISTENER_OF_THE_CQ_CQNAME_0_ERROR__1, new Object[] { cqName, ex.getMessage() }));
if (isDebugEnabled) {
logger.debug(ex.getMessage(), ex);
}
}
} else {
this.cache.getCachePerfStats().incDeltaFullValuesRequested();
cqEvent = new CqEventImpl(cQuery, cqEvent.getBaseOperation(), cqEvent.getQueryOperation(), cqEvent.getKey(), newVal, cqEvent.getDeltaValue(), cqEvent.getQueueManager(), cqEvent.getEventID());
if (cqEvent.getThrowable() != null) {
cqListeners[lCnt].onError(cqEvent);
} else {
cqListeners[lCnt].onEvent(cqEvent);
}
if (fullValue != null) {
fullValue[0] = newVal;
}
}
}
}
// Handle client side exceptions.
} catch (Exception ex) {
if (!cache.getCancelCriterion().isCancelInProgress()) {
logger.warn(LocalizedMessage.create(LocalizedStrings.CqService_EXCEPTION_IN_THE_CQLISTENER_OF_THE_CQ_CQNAME_0_ERROR__1, new Object[] { cqName, ex.getMessage() }));
if (isDebugEnabled) {
logger.debug(ex.getMessage(), ex);
}
}
} catch (VirtualMachineError err) {
SystemFailure.initiateFailure(err);
// now, so don't let this thread continue.
throw err;
} catch (Throwable t) {
// Whenever you catch Error or Throwable, you must also
// catch VirtualMachineError (see above). However, there is
// _still_ a possibility that you are dealing with a cascading
// error condition, so you also need to check to see if the JVM
// is still usable:
SystemFailure.checkFailure();
logger.warn(LocalizedMessage.create(LocalizedStrings.CqService_RUNTIME_EXCEPTION_IN_THE_CQLISTENER_OF_THE_CQ_CQNAME_0_ERROR__1, new Object[] { cqName, t.getLocalizedMessage() }));
if (isDebugEnabled) {
logger.debug(t.getMessage(), t);
}
}
}
}
Aggregations