Q1:
只有这些 vendor支持集群上的 Hibernate L2 缓存,我说得对吗?
Q2:
Hibernate L2 缓存有什么替代品吗? (也许是一些数据库缓存?)
Q1。 EhCache 作为分布式的 Hibernate L2 Cache 工作得非常好。
我们将其用于我们的项目。
Q2。多个缓存是可能的。
However, the problem with the database
cache is that it is physically on the
database server, so each query
involves a network call (latency,
bandwith ..). That's the whole point
of the caches on the application
server.
In a distributed context, this often
translates into invalidating a
category at a time when one of their
entities is modified, which is functionally
logical for us (and essential for
performance, as otherwise we would
have to invalidate all of these
entities ; this is because the cache
invalidates a whole region, or a
specific object, but in
between you have to loop which is bad for performance)
我确定还有其他人......
所以这种情况与数据库没有密切关系,它通常不存储我们的 Hibernate 实体。我们将它放在业务层(而不是数据访问或 Daos),使其直接可用于业务代码。请注意,对我们来说,它不是透明缓存,而是对执行操作或传递值的显式业务服务的调用(负责此缓存:如果数据不存在则加载它,根据需要使其无效)。
A fun Threading issue in this cache : because this cache is accessed by our hundred web threads, it needs to be thread-safe. You probably know why a thread-safe value is either immutable or cloned at each call (which often is a performance problem). So all our business caches use immutable objects, and performance is great.
您也可以使用[Infinispan(JBoss Cache 的演变)作为二级缓存提供程序!][1]
[1]:见 http://infinispan.blogspot.com/2009/10/infinispan-based-hibernate-cache.html
EhCache 具有分布式模式,但我不确定 Hibernate 是否支持这种模式。不过,我不明白为什么它不应该工作。
您是否因为某些特定原因而忽略了 JBossCache 3?
hibernate-redis lib 将是完美的选择。这是一个基于 Redis 的缓存。
为什么选择 Redis?它速度极快,可在云中运行,并具有 AWS Elasticache 等现成的云解决方案,因此您无需自行管理。
我想设置一个默认日期,例如实际日期,我该如何设置?还有如何在组合框中设置默认值顺便问一下,date_field_tag和date_field之间有什么区别? 最佳答案 试试这个:将默认日期作为第二个参数传递。youcorrectlysetthedefaultvalueofcomboboxasshowninyourquestion. 关于ruby-on-rails-date_field_tag,如何设置默认日期?[rails上的ruby],我们在StackOverflow上找到一个类似的问
我将我的Rails应用程序部署到OpenShift,它运行良好,但我无法在生产服务器上运行“Rails控制台”。它给了我这个错误。我该如何解决这个问题?我尝试更新rubygems,但它也给出了权限被拒绝的错误,我也无法做到。railsc错误:Warning:You'reusingRubygems1.8.24withSpring.UpgradetoatleastRubygems2.1.0andrun`gempristine--all`forbetterstartupperformance./opt/rh/ruby193/root/usr/share/rubygems/rubygems
我正在尝试从Postgresql表(table1)中获取数据,该表由另一个相关表(property)的字段(table2)过滤。在纯SQL中,我会这样编写查询:SELECT*FROMtable1JOINtable2USING(table2_id)WHEREtable2.propertyLIKE'query%'这工作正常:scope:my_scope,->(query){includes(:table2).where("table2.property":query)}但我真正需要的是使用LIKE运算符进行过滤,而不是严格相等。然而,这是行不通的:scope:my_scope,->(que
我试过重新启动apache,缓存的页面仍然出现,所以一定有一个文件夹在某个地方。我没有“公共(public)/缓存”,那么我还应该查看哪些其他地方?是否有一个URL标志也可以触发此效果? 最佳答案 您需要触摸一个文件才能清除phusion,例如:touch/webapps/mycook/tmp/restart.txt参见docs 关于ruby-如何在Ubuntu中清除RubyPhusionPassenger的缓存?,我们在StackOverflow上找到一个类似的问题:
尝试在我的RoR应用程序中实现计数器缓存列时出现错误Unknownkey(s):counter_cache。我在这个问题中实现了模型关联:Modelassociationquestion这是我的迁移:classAddVideoVotesCountToVideos0Video.reset_column_informationVideo.find(:all).eachdo|p|p.update_attributes:videos_votes_count,p.video_votes.lengthendenddefself.downremove_column:videos,:video_vot
我有一个.pfx格式的证书,我需要使用ruby提取公共(public)、私有(private)和CA证书。使用shell我可以这样做:#ExtractPublicKey(askforpassword)opensslpkcs12-infile.pfx-outfile_public.pem-clcerts-nokeys#ExtractCertificateAuthorityKey(askforpassword)opensslpkcs12-infile.pfx-outfile_ca.pem-cacerts-nokeys#ExtractPrivateKey(askforpassword)o
我了解instance_eval和class_eval之间的基本区别。我在玩弄时发现的是一些涉及attr_accessor的奇怪东西。这是一个例子:A=Class.newA.class_eval{attr_accessor:x}a=A.newa.x="x"a.x=>"x"#...expectedA.instance_eval{attr_accessor:y}A.y="y"=>NoMethodError:undefinedmethod`y='forA:Classa.y="y"=>"y"#WHATTT?这是怎么回事:instance_eval没有访问我们的A类(对象)然后它实际上将它添加到
我有一个集合选择:此方法的单选按钮是什么?谢谢 最佳答案 Rails3中没有这样的助手。在Rails4中,它是collection_radio_buttons. 关于ruby-on-rails-rails上的ruby:radiobuttonsforcollectionselect,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/18525986/
我正在尝试将cucumber项目的用户名和密码置于版本控制之外。有没有办法在命令行上手动将用户名和密码等变量传递给Cucumber脚本?我的备份计划是将它们放在一个YML文件中,然后将该文件添加到gitignore,这样它们就不会被置于版本控制中。 最佳答案 所以,我看到了您对铁皮人的评论,答案是肯定的。cucumberPASSWORD=my_passwordPASSWORD被设置为环境变量,您可以通过将其引用为ENV['PASSWORD']来使用它的值。例如,browser.text_field(:id=>'pwd').setEN
我刚刚迈出了编程的第一步。我刚刚完成了CodeAcademy的另一门类(class)。这次我被要求创建一个小电影目录。这是我的问题:如何在文件中保存/加载带有电影标题和评级的哈希值而不是自己的代码?下面是代码现在的样子(几句葡萄牙语,但您可以忽略它:movies={Memento:3,Primer:4,Ishtar:1}puts"Oquevocêgostariadefazer?"puts"--Digite'add'paraadicionarumfilme."puts"--Digite'update'paraatualizarumfilme."puts"--Digite'display'