private ConfigurationBuilder getProtobufMetadataCacheConfig() {
GlobalConfiguration globalConfiguration = cacheManager.getGlobalComponentRegistry().getGlobalConfiguration();
CacheMode cacheMode = globalConfiguration.isClustered() ? CacheMode.REPL_SYNC : CacheMode.LOCAL;
ConfigurationBuilder cfg = new ConfigurationBuilder();
cfg.transaction()
.transactionMode(TransactionMode.TRANSACTIONAL).invocationBatching().enable()
.transaction().lockingMode(LockingMode.PESSIMISTIC).syncCommitPhase(true).syncRollbackPhase(true)
.locking().isolationLevel(IsolationLevel.READ_COMMITTED).useLockStriping(false)
.clustering().cacheMode(cacheMode).sync()
.stateTransfer().fetchInMemoryState(true)