cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeny Ryabitskiy <evgeny.ryabits...@gmail.com>
Subject Re: Cayenne 3.0 cache RefreshQuery for NamedQuery
Date Tue, 20 Jul 2010 19:58:12 GMT
2010/7/20 Andrus Adamchik <andrus@objectstyle.org>:
> So how do we solve it? I would like to avoid tying a "query execution event"
> directly to cache refresh. Maybe instead we can attach this new type of
> events (at the beginning EJBQL/SQLTemplate events) to the same set of
> listeners as entity events? A listener can be defined to do a cache refresh
> of a certain group, or do something else entirely. Even the events can be
> defined in terms of specific entities. E.g. "query X generates 'post-update'
> event for entity Y" ... or not :-) Something to think about...

I am glad that it gave us some "food for brain"! :)

But I should remind that my issue wasn't about adding SQLTemplate events...
I just show that events can't solve this issue. But even if it could,
I'm not sure what I would prefer... configuring listeners on
SQLTemplate events or just put "removeCacheGroup" method invocation
after each "performNotSelectionQuery".
Second one seems even easier... and already available in 3.0...

One more thing... would we pay some CPU cost on SQLTemplate event
initialization? Like iterating through Collection of Listeners...
One business operation could generate ~ 8000 SQLTemplate queries. I
don't wish to lose here any performance!....
Actually I'm looking for any solution that could speed up them.... but
it's another topic...

Evgeny.

P.S.
And one more off-top :)
For me: Most advantage of Cayenne above so popular Hibernate is it
simplicity. For simple things it does simple actions! And doest it
fast!
Maybe this project should stay on this way, and not to follow it's
neighbor overloading every operation with lot's of features just to be
super flexible super universal....?
Please, don't think that I am trying to dictate you where to lead
Cayenne. Just some opinion :)








>
> On Jul 20, 2010, at 5:51 PM, Evgeny Ryabitskiy wrote:
>>
>> Thx, for your reply.
>>
>> Now, I see only events related with Entity manipulations. Is there a
>> way to add listener for NamedQuery execution?
>>
>> As I understand Event listeners could be configured in some "static"
>> section while Cayenne configuration initialization...
>> It's not so bad until you have ~30 cashed tables and almost 100-200
>> queries to that tables.
>> Problem that it's had to monitor that all Update queries got their
>> listener when this information is decomposed between Java Code and XML
>> with SQL Templates.
>>
>> Idea was to create such architecture where "Persistent" (DBMS related)
>> layer is separate from Java logic and caching could be handled by only
>> map.xml changes.
>>
>> Evgeny.
>
>

Mime
View raw message