English 中文(简体)
Hiber cache: 所有固定数据
原标题:Hiber cache : Cache all fixed data permanently

我没有像有固定数据的国家、邦城市这样的表格。 用户没有在这些数据中输入任何数据。 我为国家、国家、城市造席。 很少有人用固定数据绘制地图。 我的要求是,无论何时向国家解放党提出过任何要求(21),它都不会打上数据库,而是从海滩上退回数据。 在Hibernate是可能的。 我需要几个要点和你们的意见,以便在我的项目中执行。 我正在使用温和的说明。

最佳回答

我的要求是,无论何时向国家解放党提出过任何要求(21),它都不会打上数据库,而是从海滩上退回数据。 在Hibernate是可能的。

是的,这有可能使用第二级Cache,而这种实体(现在只有)是最佳的海滩候选人(最容易管理)。 你们需要:

  • enable the 2nd level cache
    • set the hibernate.cache.use_second_level_cache property to true in your configuration
  • choose a 2nd level cache provider (I suggest EHCache)
    • set the hibernate.cache.provider_class property accordingly
  • mark your entities as cacheable (using the read-only strategy)
    • Add @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) to your entities

References

More Resources

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签