Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: (long) Sniffing redo logs to maintain cache consistency?

Re: (long) Sniffing redo logs to maintain cache consistency?

From: <ctcgag_at_hotmail.com>
Date: 27 Feb 2003 15:50:10 GMT
Message-ID: <20030227105010.175$Ur@newsreader.com>


Noons <nsouto_at_optusnet.com.au.nospam> wrote:
>
> > A user opens up a project, looks up his task,
> > and sets the task state to "completed". The business logic will
> > change the task's state to "completed" and updates any
> > dependent tasks, setting those to "ready".
>

...
> Now, updating the task's state is trivial. The problem is
> when you have to "cascade" to other dependent tasks.
> How do you handle that WITH the Java cache?
>
> Answer: you don't. You let the database handle that. It's
> already defined there, you don't need to duplicate it in
> your objects!

...
> If the timestamps are the same, the code in the stored
> procedure marks the task as complete and updates the
> timestamp. AND it marks any other dependent tasks as
> complete as well, with changes to THEIR timestamps.
> Ie, it cascades. This is all doens in the db, by the stored
> procedure, with no intervening JDBC anyehere.
>
> When finished, it returns to the DAO a status saying:
> "I have cascaded!".
> The DAO returns that to the object in cache and a method
> somewhere in there is activated to send a little blink to
> the user that "this has caused dependent tasks to be changed".
> Just a nice warning. Possibilities in there too for other
> handling, but I won't go into it now.

But this cascaded warning would only go to the original user.

> Now the user keeps on working and eventually selects one of the tasks
> that was cached in the object cache, was changed in the db as a result
> of a cascade, but the object cache knows nothing about it.
>
> He then tries to set it to complete. Object code calls the DAO,
> this one calls the stored proc, this one checks the timestamps
> and BANG!, we are at step one of this little exercise above.
>
> See? Bingo, there is your object cache to data cache synch
> done on the cheap, efficiently and with minimal impact to
> the user.

Maybe I'm missing something, but this seems to have a very large impact on the users. Rather than getting stale data warnings once in a blue moon, wouldn't you get them all the time? Even worse, if you look at the data and don't try to change it, you never know it's stale? When people complete their tasks, my tasks get changed (in the database only) from "Waiting on dependency" to "Ready for you to start", but when I view my task list from the cached data, I still see them as Waiting. And I will continue to see Waiting until someone updates my tasks (through java) and gets a stale data warning, or some kind of checkpoint is done.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB
Received on Thu Feb 27 2003 - 09:50:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US