[JBossCache] - PojoCacheListener fqn recovery
by mc.coder
I know this question has been asked before but I've done a search in this forum for clues on how to get back the fqn reference to the object that triggered a PojoCacheListener event and I don't believe this has been fully answered. I found two references recommend using AopUtils for this purpose as in the below:
BaseInterceptor inter = (BaseInterceptor) AopUtil.findCacheInterceptor(((Advised) obj)._getInstanceAdvisor());
Where obj is the source object retrieved from the event. The issue here is that with 2.0.0.GA this returns the internal fqn (other posts indicate this issue as well) which isn't useful.
Is this a bug? (I suspect not)
Is there a fix for this or another way to get back the user provided fqn used to attach the original object to the cache. There are many applications for this feature and not having it makes things very difficult.
If there is an answer to this somewhere out there please provide a reference as I haven't been able to find it after a day or so of debugging/looking.
Thank you. I've been using JBoss PojoCache for several weeks now and it's one of the nicest solutions for distributed caching I have used.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110385#4110385
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110385
18 years, 4 months
[JBoss AOP] - Re: Maven 2 plugin?
by mc.coder
I'm a new user of JBoss AOP and was introduced to it through my growing use of JBoss Cache. I have a few questions and your help is appreciated.
I've read through this thread and whatever else I could find on setting the classpath for the maven-jbossaop-plugin compiler, but I am still unable to get it to work properly. I am trying to compile a class with the maven aop plugin which relies on other classes that are contained in jar files. The jar dependencies in question are reffered to in my pom, but the maven plugin is not adding my pom dependencies to the compiler classpath. It looks to me as though it is setting it's classpath by including only the dependencies in the maven-jbossaop-plugin pom.
To understand why this might be happening I took a look at the code for JBossAOPCMojo.java in the svn repository (http://anonsvn.jboss.org/repos/jbossas/projects/aop/trunk/maven-jbossaop-...)
and if I am looking at the latest version of the code it looks like the code that would have added the project artifact dependencies is commented out in the createClassPathList method.
1. Is this commented out for a reason? Is there any chance that you guys can provide a quick fix for this? It looks like uncommenting this might give me the behavior that I need. Please correct me if I'm wrong in my assumption. I need the ability to compile classes that have dependencies on jars.
2. What is the official repository location and version number of the maven-jbossaop-plugin that we should be using?
3. I'd appreciate any links to docs that you may have on this plugin that cover configuration or other aspects of usage. I haven't had much luck finding references on my own. I have tried adding elements inside of the element in my plugin definition with no luck.
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110374#4110374
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110374
18 years, 4 months
[EJB 3.0] - How to retrieve foreign key instead of the object (want no l
by lpmon
Goal: ability to retrieve the foreign key without loading the related object/table row.
Scenario:
Entity bean contains a related entity bean.
@Entity
class Unit{ // Unit table
// what kind of unit
Model model; // related object in Model table, related column is modelId
In the Unit table there is a column called modelId to point to the row in the Model table. If I want this key value I can use
Unit u = .... somehow get it with EntityManager or whatever;
int modelId = u.getModel().getId(); // causes read of Model table!
Issue - this will cause a read of the model row from the DB (won't it, as in lazy loading will perform a JIT read)
I only need the modelId which is in the Unit table. It seems there should be a way to do this and not load the related object.
One can do this with EJBQL by using the reserved Class.id syntax. How can I take advantage of that in the ORM classes?
I used a simple example. In my app if I can accomplish this I can easily avoid a lot of unwanted DB fetches.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110371#4110371
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110371
18 years, 4 months