此内容没有您所选择的语言版本。

Chapter 5. Return Values


5.1. About Return Values

Values returned by cache operations are referred to as return values. In Red Hat JBoss Data Grid, these return values remain reliable irrespective of which cache mode is employed and whether synchronous or asynchronous communication is used.

5.2. Disabling Return Values

As a default in Red Hat JBoss Data Grid, the put() and remove() API operations return the original or previous values in the cache. However, if the original value was not required, this operation is wasteful.

To conserve the resources used, disable the return values. Note that this solution is only applicable for cache instances that only perform write operations (for example put() and remove()). Implement this solution as follows:

Procedure: Disable Return Values

  1. Set the IGNORE_RETURN_VALUES flag. This flag signals that the operation’s return value is ignored. For example:

    cache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES)
    Copy to Clipboard Toggle word wrap
  2. Set the SKIP_CACHE_LOAD flag. This flag does not load entries from any configured CacheStores. For example:

    cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_LOAD)
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat