[JBoss Cache: Core Edition] - JPA entity caching with JBossCache in JBoss-5.0 GA
by jaikiran
I'm trying to move a EJB3 JPA example which has second level cache enabled to JBossAS-5.0 GA. I am following this wiki for instructions http://www.jboss.org/community/docs/DOC-13200. Based on those instructions i have been able to get the example deploying successfully in JBoss-5 GA. I have a couple of related questions:
1) Is there a way to access this second level cache from within the application (ex: from a EJB3 bean). I see that the java:CacheManager is registered in the JNDI. So would the following be the correct thing to do:
| private Cache getCache() throws Exception
| {
| org.jboss.cache.CacheManager cacheManager = (CacheManager) new InitialContext().lookup("java:CacheManager");
| return cacheManager.getCache("mvcc-entity", false);
| }
|
The org.jboss.cache.CacheManager.getCache() accepts 2 arguments. I could not find the javadocs and wasn't sure what to pass. Based on some explanation from the wiki, i decided to pass mvcc-entity as the first param. What exactly are these parameters used for?
2) Once i get hold of the cache, is there some way through which i can figure out whether a particular entity is cached?
public boolean isCustomerInCache(Long id){
|
| Cache cache = getCache();
| // is there some way through which i can check if the entity is cached?
|
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198722#4198722
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198722
17 years, 3 months
[JBoss Tools (users)] - Re: ganymede and jboss tool 3 problem with seam projet
by meissa
Max,
It makes a BIG difference when you say that you can't reproduce what i've described while using seam 2.0
In fact we were not completely synchronized (please be patient i'll explain all).
I've been searching and deeply testing these last three days and I'm happy because all my troubles are gone :-))
To be short:
Everything works fine with JBT 3 RC1, Seam 2.0, and eclipse Ganymede with WTP 3.0.3
Everything also works fine with JBT 3 RC1, Seam 2.1.1 GA (yes, the last one), eclipse Ganymede with WTP 3.0.3
Here are the two combinations that works perfectly with Seam project.
While you were testing seam 2.0 with ganymede and WTP 3.0.3 I was using seam 2.1.RC1. That's the reason why we were not able to produce the same results.
I think that these two working combinations should be described somewhere to prevent users from loosing times doing what I did ...
In any case, I'm thanking you for the time you spent for solving this problem.
Meissa
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198710#4198710
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198710
17 years, 3 months