|
1 | 1 | /* |
2 | | - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. |
| 2 | + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. |
3 | 3 | * |
4 | 4 | * Licensed under the Universal Permissive License v 1.0 as shown at |
5 | | - * http://oss.oracle.com/licenses/upl. |
| 5 | + * https://oss.oracle.com/licenses/upl. |
6 | 6 | */ |
7 | 7 | using System; |
8 | 8 | using System.Collections; |
@@ -2557,11 +2557,18 @@ protected bool IsEventDeferred(object key) |
2557 | 2557 | { |
2558 | 2558 | if (State <= CacheState.Configuring) |
2559 | 2559 | { |
2560 | | - // since the listeners are being configured and the local |
2561 | | - // cache is being populated, assume that the event is |
2562 | | - // being processed out-of-order and requires a subsequent |
2563 | | - // synchronization of the corresponding value |
2564 | | - cacheSyncReq[key] = null; |
| 2560 | + if (typeof(DeactivationListener).Name.Equals(key)) |
| 2561 | + { |
| 2562 | + cacheSyncReq.Clear(); |
| 2563 | + } |
| 2564 | + else |
| 2565 | + { |
| 2566 | + // since the listeners are being configured and the local |
| 2567 | + // cache is being populated, assume that the event is |
| 2568 | + // being processed out-of-order and requires a subsequent |
| 2569 | + // synchronization of the corresponding value |
| 2570 | + cacheSyncReq[key] = null; |
| 2571 | + } |
2565 | 2572 | isDeferred = true; |
2566 | 2573 | } |
2567 | 2574 | else |
@@ -3056,13 +3063,16 @@ public override void EntryUpdated(CacheEventArgs evt) |
3056 | 3063 | // "truncate" event |
3057 | 3064 | ContinuousQueryCache queryCache = m_parentQueryCache; |
3058 | 3065 | IObservableCache internalCache = queryCache.InternalCache; |
3059 | | - if (internalCache is LocalCache) |
| 3066 | + if (!queryCache.IsEventDeferred(typeof(DeactivationListener).Name)) |
3060 | 3067 | { |
3061 | | - ((LocalCache) internalCache).Truncate(); |
3062 | | - } |
3063 | | - else |
3064 | | - { |
3065 | | - internalCache.Clear(); |
| 3068 | + if (internalCache is LocalCache) |
| 3069 | + { |
| 3070 | + ((LocalCache) internalCache).Truncate(); |
| 3071 | + } |
| 3072 | + else |
| 3073 | + { |
| 3074 | + internalCache.Clear(); |
| 3075 | + } |
3066 | 3076 | } |
3067 | 3077 | } |
3068 | 3078 |
|
|
0 commit comments