Caching issue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Caching issue

John Eichelsdorfer
In using OJB 1.0.3, we are trying to add a document management piece into our system, we are trying to use extent-class for a first time to represent a Document and a DocumentWithDisplays.  Basically the DocumentWithDisplays is a Document with a collection of proxied Display objects.

This is working except for one thing.
1. Listing the documents with Displays works.
2. Deleting one of the Displays separately, not as part of the DocumentWIthDisplays query, works in the database, but when the screen attempts to re-get and re-draw the display as in #1, the document does not show up as cleared out of the proxied collection of Displays.   This occurs even though I have done a broker.removeFromCache(object) of the deleted object.
3. When I do a different query elsewhere, the object is recognized as gone, and all of a sudden it shows up in #1 correctly, but not until a different query is done.

Sounds confusing, but shouldn't the removeFromCache() have cleared the object reference and not allowed it to remained in the proxied collection of Displays?

Here is my extent-class XML description.  Maybe I am doing something wrong you can point out.  Thank you.



<class-descriptor class="com.model.document.DocumentVO"  table="document">

       
        <object-cache
                class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
                <attribute attribute-name="timeout" attribute-value="-1" />
        </object-cache>
       
        <extent-class class-ref="com.model.document.display.DocumentWithDisplaysVO" />

        <field-descriptor name="docId" column="doc_id"
                jdbc-type="BIGINT" primarykey="true" autoincrement="true" />
        <field-descriptor name="title" column="title" jdbc-type="VARCHAR" />
        <field-descriptor name="status::isDisabled" column="isdisabled" jdbc-type="INTEGER"
                conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion" />

        <reference-descriptor
                name="docContent"
                class-ref="com.model.document.DocumentContentVO"
                proxy="dynamic" auto-retrieve="true" auto-update="object" auto-delete="object">
            <foreignkey field-ref="docId"/>
        </reference-descriptor>

</class-descriptor>




<class-descriptor class="com.model.document.DocumentContentVO"
        table="doc_content">

        <field-descriptor name="docId" column="doc_id"
                jdbc-type="BIGINT" primarykey="true" />
        <field-descriptor name="content" column="content"
                jdbc-type="LONGVARCHAR" />

</class-descriptor>




<class-descriptor class="com.model.document.display.DocumentWithDisplaysVO"
        table="document">

       
        <object-cache
                class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
                <attribute attribute-name="timeout" attribute-value="-1" />
        </object-cache>

        <field-descriptor name="docId" column="doc_id"
                jdbc-type="BIGINT" primarykey="true" autoincrement="true" />
        <field-descriptor name="title" column="title" jdbc-type="VARCHAR" />
        <field-descriptor name="status::isDisabled" column="isdisabled" jdbc-type="INTEGER"
                conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion" />

        <reference-descriptor
                name="docContent"
                class-ref="com.model.document.DocumentContentVO"
                proxy="dynamic" auto-retrieve="true"
                auto-update="object" auto-delete="object">
            <foreignkey field-ref="docId"/>
        </reference-descriptor>

        <collection-descriptor name="documentDisplays"
                element-class-ref="com.model.document.display.DocumentDisplayVO"
                proxy="dynamic"
                auto-retrieve="true"
                auto-update="object"
                auto-delete="object">
            <inverse-foreignkey field-ref="docId" />
        </collection-descriptor>
</class-descriptor>



<class-descriptor class="com.model.document.display.DocumentDisplayVO"
        table="doc_display">

       
        <object-cache
                class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
                <attribute attribute-name="timeout" attribute-value="-1" />
        </object-cache>

        <field-descriptor name="docDispId" column="dsp_id"
                jdbc-type="BIGINT" primarykey="true" autoincrement="true" />
        <field-descriptor name="docId" column="doc_id" jdbc-type="BIGINT" />
        <field-descriptor name="displayCategory" column="ddc_id" jdbc-type="BIGINT" indexed="true"
                conversion="com.common.codelist.type.DocumentDisplayCategoryCL" />
        <field-descriptor name="status::isDisabled" column="isdisabled"
                jdbc-type="INTEGER"
                conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion" />

</class-descriptor>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Caching issue

John Eichelsdorfer
Sorry using OJB 1.0.3, not 1.0.4.

Seems like when I have an object A with a proxied collection of B, that when I delete and remove B from cache seperately, A's collection, upon a new query does not get the change.  This does not just have to do with delete, but any change to B.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Caching issue

John Eichelsdorfer
In reply to this post by John Eichelsdorfer
After upgrading and struggle, finally got this to work.
Loading...