Hi Luis,

> After using this catch filter for some time we've noticed that
instances
> of class's that are not supposed to be cachable show up in the cache!
>
>
> Here's the concrete situation:
>
>    Class A is not cachable.
>    Class B is cachable.
>    Class B has a reference to class A.
>
>    - Reading an object that is an instance of class A places no
objects
> in the cache.
>
>    - Reading an object that is an instance of class B places two
objects
> in the cache (one instance of class B and one instance of class A)!
> Is this behavior normal?
>
Think yes. If OJB reading an instance of class B and e.g. auto-retrieve
is set true
the reference to class A will be load too, but the cache/cacheFilter
only
realize an object of type B. The current filter implementation is not
smart
enough to detect the A instance.
Set attribute refresh="true" in reference-descritor. Then when lookup
an object of B the refernece to object A was reloaded each time.

> Does the reference to class A have to be a proxy for the "not
cachable"
> to work with references?
>
This will only work as long as you do not materialize the
real reference object, after that the "proxy" represents
an A instance too.

regards,
Armin

> Thanks in advanve,
> Luis (M)
>
> P.S. The class/table mapping for the described situation follows:
>
>    <class-descriptor
>           class="A"
>           table="A"
>    >
>       <field-descriptor id="1"
>          name="id"
>          column="ID"
>          jdbc-type="INTEGER"
>          primarykey="true"
>          autoincrement="true"
>       />
>       <attribute
>          attribute-name="cacheable"
>          attribute-value="false"
>       />
>    </class-descriptor>
>
>    <class-descriptor
>           class="B"
>           table="B"
>    >
>       <field-descriptor id="1"
>          name="id"
>          column="ID"
>          jdbc-type="INTEGER"
>          primarykey="true"
>          autoincrement="true"
>       />
>       <field-descriptor id="2"
>          name="keyToA"
>          column="KEY_TOA"
>          jdbc-type="INTEGER"
>       />
>       <reference-descriptor
>          name="a"
>          class-ref="A"
>       >
>          <foreignkey field-ref="keyToA"/>
>       </reference-descriptor>
>    </class-descriptor>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to