Uploaded image for project: 'JBoss POJO Cache'
  1. JBoss POJO Cache
  2. PCACHE-61

If more than one field of one object (A) refers to another object (B) , java.lang.IllegalStateException: PojoReference.incrementRefCount() occurs while attaching object A in the cache

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.1.0.GA
    • Component/s: Java Binding
    • Labels:
      None
    • Environment:

      Description

      If more than one field of an object (A) refers to another object (B) , trying to attach object A to cache would cause a java.lang.IllegalStateException: PojoReference.incrementRefCount(): exception.

      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?

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jason.greene Jason Greene
                Reporter:
                bahata Bahata Mukhopadhyay
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: