由买买提看人间百态

topics

全部话题 - 话题: ehcache
1 (共1页)
c******n
发帖数: 4965
1
来自主题: Java版 - EHCache --- hibernate question
I enabled ehcache as second level cache,
from TRACE level logging, I can see that hibernate/ehcache did try to place
query result/load result into cache, but every time I query with the same
parameter (i.e. there is only one uniq query), so it says
"caching xxx ..."
"xxx is already cached",
this is fine.
but it seems that after trying to read from the cache for only 1 time, it
never tries to use the cache again.
I can see on the first read, it logs:
2011-12-20 15:29:53,344 95419 INFO [org.hiber... 阅读全帖
s****y
发帖数: 503
2
我想用ehcache存一个table,放一些已经使用过的数据,防止重复使用,需要处理多线
程,是不是用synchronized就够了?还是用reentrantlock,或者其他什么方法?
b**l
发帖数: 25
3
I believe these objects are elements stored in ehcache memory store. And it
really depends on which version of
Ehcache you are using. The same issue happened in my project when I upgraded
ehcache to 1.8.
You can try to add this java parameter in your start up script,
-Dnet.sf.ehcache.use.classic.lru=true
Good luck,

see
it?
g*****g
发帖数: 34805
4
来自主题: Java版 - memcached
Don't really have any experience with memcached.
But I believe, ehCache and other Java Cache solution (JBoss Cache
etc.) gives you more control and flexibility. e.g. You can configure
ehCache as Hibernate's secondary Cache. And it's not intrusive.
Also ehCache can run in your JVM. memcached is C based.
c*****s
发帖数: 214
5
来自主题: Java版 - About Hibernate
你的发言总是这样,说一些没有根据的结论。你如果想说服别人什么就要拿出事实,方案
,数据,对比或者连接。
好的软件不是powerful,而是simple, clean。"Hibernate doesn't have its own
transaction layer"只能显示你对软件设计的理解肤浅。
hibernate是OR Mapping工具,理想的OR Mapping工具应该只做Mapping, 提供简单的接口
使用别的caching,datasource, transaction, failover... 要集成别的JTA,当然要在
配置文件里设置。如果你个工具自己偷偷摸摸提供自己transaction实现不让我知道,我
是无论如何不会去用它的。
缓冲,failover这种都是一个道理。hibernate的CacheProvider可以配置,默认用ehcach
e。觉得ehcache不好就换呗,谁都不好用就自己写呗。failover, cluster和OR Mapping
没有直接关系。一个OR Mapping工具泛得着去提供最好的缓存和failover机制吗?
想做cluster
k***r
发帖数: 4260
6
来自主题: Java版 - memcached
Right. ehcache has the advantage when it's a local cache.
memcached is a key-value pair store, better for mixed
(not only Java) solutions. I haven't got a chance to
try ehcache in a distributed way, yet.
g*****g
发帖数: 34805
7
来自主题: Java版 - 寻求java技术和解决方案
For graceful shutdown, ehCache can flush the data before
JVM got shut down. And the data can be persisted between
restarts, it's just a configuration in ehCache.
Or you can have a file-based ad-hoc caching that you can
flush whenever you feel right.
In paging, you can use your old method to load data, and
use your local changes to override modified entries
before display.
g*****g
发帖数: 34805
8
ehCache是个local cache,跟memcached比,是java实现的,可以在JVM内跑。可以定义
eviction policy,可以定义大小从而控制内存使用。ehCache也可以做成分布式的,但
GAE估计不支持。
i*******3
发帖数: 129
9
来自主题: JobHunting版 - job in silicon valley
looking for senior software engineers with a Java development background for
a profitable company, candidate should have a software background in the
following areas: JMX/JDBC/JMS/Spring experience, jboss, Hibernate, MQ,
ehCache, scalability, J2EE, Ajax, and java script.
please upload your resume to website that I can download and forward it to
recruiter.
j**y
发帖数: 462
10
来自主题: JobHunting版 - 招人 SF/Austin/NY dev , qa , devOps
still hiring, thanks guys for sending me resume, good luck for all of us!
some guys have started onsite already.
DevOps
The ideal candidate will be a Linux system administrator coder with hands-on
experience supporting highly available production systems. They are
passionate about authoring tools to reliably manage infrastructure.
Responsibilities
Linux systems operations architecture and setup
Systems monitoring and alerting strategies and implementation
Design, implement and maintain our syste... 阅读全帖
j**y
发帖数: 462
11
来自主题: JobHunting版 - 招人 SF/Austin/NY dev , qa , devOps
still hiring, thanks guys for sending me resume, good luck for all of us!
some guys have started onsite already.
DevOps
The ideal candidate will be a Linux system administrator coder with hands-on
experience supporting highly available production systems. They are
passionate about authoring tools to reliably manage infrastructure.
Responsibilities
Linux systems operations architecture and setup
Systems monitoring and alerting strategies and implementation
Design, implement and maintain our syste... 阅读全帖
d****s
发帖数: 30
12
来自主题: Java版 - About Hibernate





I don't think you have real large scale engineering experience skills either.
People need a solution, not a set of hacking tools. This is the reason
why Hibernate is not popular in industry.
缓冲,failover这种都是一个道理。hibernate的CacheProvider可以配置,默认用ehcach
Mapping
想做cluster,可以基于任何一种缓存,集成jgroup,写自己的CacheAdapter配到hiberna
I see. I guess you must be not only a OR mapping expert, also
multicasting/network guru, and a disaster reovering professional.
Once a tool offers us a set of clustering, failove
a*****a
发帖数: 1429
13
来自主题: Java版 - About Hibernate
看你这么说觉得你应该没有做过大设计。如果系统设计按照你这样的思路,
结果虽然未必不好,但风险大得很。关键是设计方案肯定过不了评审。因为
都是一些Workaround,这个在实际工程中很忌讳的.这点我同意donuts的说法。





缓冲,failover这种都是一个道理。hibernate的CacheProvider可以配置,默认用ehcach
Mapping
想做cluster,可以基于任何一种缓存,集成jgroup,写自己的CacheAdapter配到hiberna

g*****g
发帖数: 34805
14
来自主题: Java版 - memcached
ehCache is probably what you are looking for.
m****r
发帖数: 6639
15
来自主题: Java版 - 请问一个ehcache的问题
我用它的get(), 如果这个时候, 要拿的东西expire了, 那么return的是null.
有没有办法在这个时候拿还能到这个expire了的东西呢?
m******t
发帖数: 2416
16
来自主题: Java版 - 请问一个ehcache的问题

getWithLoader?
g*****g
发帖数: 34805
17
来自主题: Java版 - 寻求java技术和解决方案
In memory caching with local disk IO turning on is your friend.
You can leverage lib like ehCache.Load the hot section in memory and the
rest of it in disk.Flush on save/discard
l*****b
发帖数: 82
18
Hi, friends,
I have production env with JBoss 4.0.4 and was add ehcache in last release.
BUt it was slow down and then shutdown due to the java heap out of memory in
every 20 days after that and need reboot the jboss. So far, I have not
found the root cause, just got some symptons: java heap usage is overflow, e
.g. over 512 max to 6xx sometime, seems run out memory. But it is ok in the
19 days when I monitor the memory usage, usually have about 120 - 150M free
memory left. Do you have any idea ... 阅读全帖
l*****b
发帖数: 82
19
Hi, Goodbug,
I encountered the heap overflow issue again and got the thread dump logs.
Seems I did not see special exception. But One thing I remembered I add new
ehcache/jgroup components in the JBoss which seems has some conflict with
the built-in jboss clustering components (the old jgroup libs). I am not
sure it is the clue I could start with.
g*****g
发帖数: 34805
20
来自主题: Java版 - 探讨一个java, sql设计问题
There are simple strategies that should work fairly well.
For example, you can estimate the ratio of each type of
entity in browsing. Now use LRU eviction and configure the
number of cache entries for each type.
e.g. 1K Customers, 10K Orders if the ratio is 1:10 in average
Hibernate with ehCache get you that. You can fine tune with
in memory and secondary cache too.
You don't really care about relationship in that regard. They
are just entities that are likely being revisited soon.
b******e
发帖数: 1861
21
网上找不到答案,在这问一声。在系统里,我们设了二级缓存用ehcache。但是有几个
entity class
我们需要disable二级缓存,因为我们会有情况需要直接走jdbc去更新表,曾经想过用
api evict
cache,但是由于我们系统有多个server,不想搞cache synchronization,现在看看有
没有办法
disable cache for just some entity.
g*****g
发帖数: 34805
22
In ehcache configuration, use fully qualified class name and you can
override the default cache configuration for a type of entity.
In hbm you can also disable caching of a certain entity all together,
if that's what you want.
w*******s
发帖数: 940
23
来自主题: Java版 - any good j2ee book?
Spring MVC is basic
Spring security
Lucene/Solr
cache, ehcache, memcached....
can be desired
r*****s
发帖数: 985
24
是不是互不兼容的啊?
好像以前的@Cache by hibernate不支持method level caching
@Cachable by ehcache-spring-annotations supports it,
so i have to re-annotate every cached entities with @Cachable?
configuration is different too.
very confusing ya
r*****s
发帖数: 985
25
高了半天,
这个method level的@Cachable不是JPA的,
是com.googlecode.ehcache.annotations.Cacheable,
JPA的Cachable基本上跟Hibernate的Cache是差不多的。
b**l
发帖数: 25
26
来自主题: Java版 - 怎么把一个Map放到queue里?
轻量级的用 google guava
重量级的用 ehcache
如果不在乎lock contention 自己写一个class wrap linkedhashmap 然后所有的
method都synchronized

★ 发自iPhone App: ChineseWeb 7.8
g*****g
发帖数: 34805
27
来自主题: Java版 - 问个JAVA设计多线程cache问题
Don't reinvent the wheel, use ehCache.
g*****g
发帖数: 34805
28
通常的做法是Cache,而不是用HashMap。HashMap是strong reference,而做cache,你
更希望soft reference。另一个好处就是现有的一些Cache架构可以让你配置内存和二
级缓存的使用,以及eviction policy。一个很流行的类库是ehCache。貌似现在也支持
GAE了。

DataStore
b***i
发帖数: 3043
29
学了,原来还有Cache这个interface。这个ehCache是分布式的还是就是servlet内部使
用的?如果是分布式的,跟GAE自己的有什么好处?
如果是servlet内部的,那到比HashMap好,内存不会不够了。
g*****g
发帖数: 34805
30
来自主题: Programming版 - 怎么把一个Map放到queue里? (转载)
You are better served with a DB. Alternatively, if you really want to use a
cache. EhCache is your friend, whatever eviction policy you want to specify,
no need to reinvent the wheel.
As a java programmer, the first question is not how I can implement it,
rather what library has implemented it.
g*****g
发帖数: 34805
31
来自主题: Programming版 - 怎么把一个Map放到queue里? (转载)
DB跟EhCache都不是什么重量级的东西,你也太大惊小怪了。她在java版发帖再转过来,
假定是java写的很自然。
g*****g
发帖数: 34805
32
来自主题: Programming版 - 怎么把一个Map放到queue里? (转载)
看来你没有理解问题的本质在哪里。我提的DB,和EhCache,哪怕ConcurrentHashMap吧
,都是线程安全的。同步不需要在你自己的代码里做,人已经做好了,而且支持高并发
,而不是锁死排队单线程访问。人要轮子,我说1小时够了,你说20分钟能上个木墩,
基本就是
如此。
c******o
发帖数: 1277
33
来自主题: Programming版 - MongoDB力压Cassandra
play自带ehcache,建个cluster.
t**********s
发帖数: 930
34
只找到了一个 catalina.properties:
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... 阅读全帖
g*****g
发帖数: 34805
35
来自主题: Programming版 - 没有data store的model有什么用吗?
你关于model的说法没有错,一般叫做data transfer object. 至于 caching跟MVC没有
什么关系。如果单机可以用
ehcache. cluster可以用独立的redis或者 memcached. cache都是 LRU,资源使用是可
控的。
W***o
发帖数: 6519
36
来自主题: Programming版 - 没有data store的model有什么用吗?
ehcache 吗?
s****y
发帖数: 503
37
我写了一个包装Ehcache的类EhcacheWrapper,加入多线程控制,代码如下
@service
public class EhcacheWrapper{
public Element get(String cacheName, String key){......}
public void put(String cacheName, String key, Object value){......}
//多线程控制,代码略
}
我在一个controller中自动装配EhcacheWrapper,比如
public class GetLabelServiceImpl{
@Autowired
private EhcacheWrapper ehcacheWrapper;
//代码略
}
我在其他controller中还能@Autowired EhcacheWrapper吗?
我觉得@Component默认的scope是singleton,只有一个实例。如果在两个类中都@
Autowired EhcacheWrapper,是不是两个类都调用同一个b... 阅读全帖
1 (共1页)