You need to be a bit more descriptive about the error you see - I can't make out much from what little you have told me.
I am really sorry for not being clear. But now I have probably pinpointed the problem and could reproduce it and explain it with a simpler example.
Say I have a Person class with two fields PrimaryAddress and SecondaryAddress. Now say I created a single address object A and assigned both the addresses to that
address A. Now if I try to attach the Person in my cache, it gives the exception
" java.lang.IllegalStateException: PojoReference.incrementRefCount(): source fqn: /__JBossInternal__/pg/_ID_/aaa4z-hq7ub6-fdr124m4-1-fdr1256j-9 is already present."
I understand that, this is because the person object is trying to refer to the Address object twice, because of its two fields .So the PojoInstance.incrementRefCount() method is throwing the exception.
Now if I assign PrimaryAddress and SecondaryAddress fields of Person to diffrent Address objects, this exception disappears.
But in our product There are classes where two of its fields need to point to the same object. We are creating the object graph using hibernate association and are implementing pojo cache in front of hibernate(not .as second level cache for certain reasons)
So can you kindly suggest a fix or any workaround for this problem?
Thanks a lot for your previous reply.
Waiting to hear from you.