cache « EJB « JPA Q&A





1. @Cache annotation usage error    stackoverflow.com

I added the following annotation to enable cache to one of my EJB3 entities, to test caching with ehCache, where I use Hibernate as the persistence provider:

....
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "F")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
@NamedQueries({ ...

2. Caching EJB entities using JBoss Hibernate cache (JBoss-5.0.0.GA)    stackoverflow.com

My applications very often queries database for rarely-changed data. So I've decided to optimize it using cached EJB entities as desribed in: http://docs.jboss.org/ejb3/docs/tutorial/1.0.7/html/Caching_EJB3_Entities.html However, when I take a look at hibernate ...

3. Cache JPA Entities with EJB    stackoverflow.com

[The real question is marked in bold down. Here follows an as short as possible explaination of my situation] I have the following JPA Entities:

@Entity Genre{
 private String name;
 @OneToMany(mappedBy = "genre", ...