HHH-11226 Hibernate cache throws NullPointerException during wildfly app server startup
This commit is contained in:
parent
79ff7aec5b
commit
fe3957df0c
|
@ -36,7 +36,6 @@ public class CacheCommandFactory implements ExtendedModuleCommandFactory {
|
|||
/**
|
||||
* Add region so that commands can be cleared on shutdown.
|
||||
*
|
||||
* @param regionName name of the region
|
||||
* @param region instance to keep track of
|
||||
*/
|
||||
public void addRegion(BaseRegion region) {
|
||||
|
@ -46,7 +45,7 @@ public class CacheCommandFactory implements ExtendedModuleCommandFactory {
|
|||
/**
|
||||
* Clear all regions from this command factory.
|
||||
*
|
||||
* @param regionNames collection of regions to clear
|
||||
* @param regions collection of regions to clear
|
||||
*/
|
||||
public void clearRegions(Collection<BaseRegion> regions) {
|
||||
regions.forEach( region -> allRegions.remove( region.getName() ) );
|
||||
|
|
|
@ -44,7 +44,11 @@ public class EvictAllCommand extends BaseRpcCommand {
|
|||
|
||||
@Override
|
||||
public Object perform(InvocationContext ctx) throws Throwable {
|
||||
region.invalidateRegion();
|
||||
// When a node is joining the cluster, it may receive an EvictAllCommand before the regions
|
||||
// are started up. It's safe to ignore such invalidation at this point since no data got in.
|
||||
if (region != null) {
|
||||
region.invalidateRegion();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue