You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Tomi NA <he...@gmail.com> on 2006/05/10 15:17:13 UTC

dump cache contents

Hi everyone,

I have a problem in a system with a dozen very active concurrent users
of my webapp. Because the app attacks the same records in the database
by nature ("get best candidate for next iteration"-style of work), the
cache issue is very sensitive. I've seen errors pop up, but I can't
tell if they're a result of bad design/programming or user error. That
is to say, I can't tell...yet.

\What I'd like to do is log cache contents before critical operations
occur. Something along the lines of
dataContext.getCurrentCache().dumpContentsToText() would be
instrumental to the level of understanding I need to be able to solve
this problem or guarantee it's not an application problem. To this
end, I'd reduce the number of objects kept in cache (say, just a
couple of dozens). BTW, is there a way to completely circumvent the
cache?

Oh: I'm using 1.2B1 on this project. It's a lot of work to update it
to 1.2B2. Can anyone comment, please?

Tomislav

Re: dump cache contents

Posted by Cris Daniluk <cr...@gmail.com>.
> The problem is that I can't reproduce an error in the controled
> environment in which I debug. This is why I need as much relevant
> information as possible. Still, I believe I've thought of a way to log
> everything I need.

Rather than log it, why not serialize it to disk? Then, you can build
a simple wrapper to read it... I do it all the time when I can't use a
debugger (though the remote debugging stuff in modern IDEs and app
servers works really really well)

> This doesn't make me stop wondering why in heavens name there isn't a
> general "turn off all cache and go to the DB for every bit of data"
> switch. Ah well...

Like I said, there is... it's what I described previously.

Cris

Re: dump cache contents

Posted by Tomi NA <he...@gmail.com>.
On 5/10/06, Cris Daniluk <cr...@gmail.com> wrote:
> It depends on what you mean when you say cache :)
>
> If you disable shared caching, each DataContext will have its own
> DataRowStore. That gets rid of "shared caching" (cleverly). Then, you
> can discard the DataContext after each operation to get rid of "local"
> caching...
>
> And you can dump the DataRowStore for debugging, though odds are its
> going to be huge and not very helpful to you. Better to use a
> debugger!

The problem is that I can't reproduce an error in the controled
environment in which I debug. This is why I need as much relevant
information as possible. Still, I believe I've thought of a way to log
everything I need.
This doesn't make me stop wondering why in heavens name there isn't a
general "turn off all cache and go to the DB for every bit of data"
switch. Ah well...

Tomislav

Re: dump cache contents

Posted by Cris Daniluk <cr...@gmail.com>.
It depends on what you mean when you say cache :)

If you disable shared caching, each DataContext will have its own
DataRowStore. That gets rid of "shared caching" (cleverly). Then, you
can discard the DataContext after each operation to get rid of "local"
caching...

And you can dump the DataRowStore for debugging, though odds are its
going to be huge and not very helpful to you. Better to use a
debugger!

Cris

On 5/10/06, Tomi NA <he...@gmail.com> wrote:
> Hi everyone,
>
> I have a problem in a system with a dozen very active concurrent users
> of my webapp. Because the app attacks the same records in the database
> by nature ("get best candidate for next iteration"-style of work), the
> cache issue is very sensitive. I've seen errors pop up, but I can't
> tell if they're a result of bad design/programming or user error. That
> is to say, I can't tell...yet.
>
> \What I'd like to do is log cache contents before critical operations
> occur. Something along the lines of
> dataContext.getCurrentCache().dumpContentsToText() would be
> instrumental to the level of understanding I need to be able to solve
> this problem or guarantee it's not an application problem. To this
> end, I'd reduce the number of objects kept in cache (say, just a
> couple of dozens). BTW, is there a way to completely circumvent the
> cache?
>
> Oh: I'm using 1.2B1 on this project. It's a lot of work to update it
> to 1.2B2. Can anyone comment, please?
>
> Tomislav
>