I do not expect to automatically update the object in cache representing the 
view.
After the update of A or B I explicitely read the view. At that point my 
expactation was to retrieve the new value. The SQL statement returns the 
correct (new) value, but ojb uses the object from the cache with the old value. 
This confuses me a little.

Best regards,
Frank


-----Ursprüngliche Nachricht-----
Von: Charles Anthony [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 19. September 2006 15:23
An: OJB Users List
Betreff: RE: Support of database views

No, it's not really a bug; 

Let's say you have objects A, B and C where C is an objject mapped onto a view 
joining A & B. 

OJB Caches objects on their Class + PK; when you update an object, it is 
ejected from the cache based on it's class and PK.

So, let's say C with a PK of one is references A with a PK of 2

You read from C -> C[1] is inserted in the cache You read A -> A[2] is inserted 
in the cache You update A -> A[2] is dropped from the cache but C[1] is still 
in the cache.

OJB doesn't (and can't) know about the relationship between A & C

If all updates are done from OJB, and if you can derive the PK of C (in the 
above example) from A, then you could implement some kind of listener that says 
"whenever A is updated, drop C from the cache"

You might also be able to specify that C should never be cached (by specifying 
the org.apache.ojb.broker.cache.ObjectCacheEmptyImpl in object-cache element 
for the class in the repostory.xml)


Cheers,
Charles.


> -----Original Message-----
> From: Hiller, Frank RD-AS2 [mailto:[EMAIL PROTECTED]
> Sent: 19 September 2006 14:09
> To: OJB Users List
> Subject: AW: Support of database views
> 
> Additional information: When I explicitely remove the objects from the 
> brokers internal cache (broker.removeFromCache(obj)) it works.
> Is it a bug?
> 
> Frank
> 
> -----Ursprüngliche Nachricht-----
> Von: Hiller, Frank RD-AS2 [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 19. September 2006 13:56
> An: OJB Users List
> Betreff: AW: Support of database views
> 
> Hi Vasily,
> 
> using the view as a table (following your recommendation) shows a 
> strange behaviour.
> When a field in a table is updated and the matching object returns the 
> correct new value the object related to the view (spanning two tables 
> ) still holds the old value for a long time (minutes).
> 
> Have you (or soneome else) ever had such a problem?
> Is there something I can configure (in ojb.properties)?
> 
> I'm using OJB 1.0.3 with PB api.
> 
> Frank
> 
> -----Ursprüngliche Nachricht-----
> Von: Vasily Ivanov [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 12. September 2006 01:19
> An: OJB Users List
> Betreff: Re: Support of database views
> 
> Hi Frank,
> 
> We used to work with views without any issue, just put view's name as 
> "table" attribute in "class-descriptor". However, you will only be 
> able to read objects from that view.
> 
> Regards,
>   Vasily
> 
> On 9/11/06, Hiller, Frank RD-AS2 <[EMAIL PROTECTED]> wrote:
> > Short question: I couldn't find a functionality to deal
> with database
> > views (create view...) within OJB.
> > Is there a reason for that?
> > Is the answer "use ReportQuery".
> >
> > Thank you,
> > Frank
> >
> >
> >
> > Confidentiality note:
> > The information in this email and any attachment may
> contain confidential and proprietary information of Heidelberger 
> Druckmaschinen AG and/or its affiliates and may be privileged or 
> otherwise protected from disclosure. If you are not the intended 
> recipient, you are hereby notified that any review, reliance or 
> distribution by others or forwarding without express permission is 
> strictly prohibited and may cause liability. In case you have received 
> this message due to an error in transmission, we kindly ask you to 
> notify the sender immediately and to delete this email and any 
> attachment from your system.
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> Confidentiality note:
> The information in this email and any attachment may contain 
> confidential and proprietary information of Heidelberger 
> Druckmaschinen AG and/or its affiliates and may be privileged or 
> otherwise protected from disclosure. If you are not the intended 
> recipient, you are hereby notified that any review, reliance or 
> distribution by others or forwarding without express permission is 
> strictly prohibited and may cause liability. In case you have received 
> this message due to an error in transmission, we kindly ask you to 
> notify the sender immediately and to delete this email and any 
> attachment from your system.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> Confidentiality note:
> The information in this email and any attachment may contain 
> confidential and proprietary information of Heidelberger 
> Druckmaschinen AG and/or its affiliates and may be privileged or 
> otherwise protected from disclosure. If you are not the intended 
> recipient, you are hereby notified that any review, reliance or 
> distribution by others or forwarding without express permission is 
> strictly prohibited and may cause liability. In case you have received 
> this message due to an error in transmission, we kindly ask you to 
> notify the sender immediately and to delete this email and any 
> attachment from your system.
> 
> ---------------------------------------------------------------------
> 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]


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

Reply via email to