ehcache磁盘存储可以同时安全访问吗? [英] Can ehcache diskstore be safely accessed concurrently?

查看:189
本文介绍了ehcache磁盘存储可以同时安全访问吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到DiskStore的位置有一个.lock文件。我一直明白,使文件IO原子化是困难的,有时是不可能的。所以,我的期望是多个应用程序不能安全地使用相同的ehcache DiskStore。然而,锁文件让我感到惊讶。性能瓶颈,可以工作吗?

上下文:我想知道是否两个Java Servlet上下文运行相同的应用程序可以共享一个DiskStore。

解决方案

答案是否定的。 您可以使用 Terracotta服务器阵列。或者,作为第二种选择,复制缓存可能适合您以及每个应用程序/实例具有它自己的本地DiskStore的地方。


I see the DiskStore location has a .lock file. I've always understood that it is difficult and sometimes impossible to make file IO atomic. So, my expectation is that multiple applications cannot safely use the same ehcache DiskStore. However, the lock file makes me wonder. Performance bottlenecks aside, can it work?

Context: I'm wondering if two Java Servlet contexts running the same application could share a DiskStore.

解决方案

The answer is no.

You could use Terracotta server array instead. Or, as a second alternative, a replicated cache might suit you as well where each application / instance has it's own local DiskStore.

这篇关于ehcache磁盘存储可以同时安全访问吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆